pub struct AnsiBackend<W: Write> { /* private fields */ }Expand description
A backend that writes ANSI escape codes to any Write sink.
Implementations§
Source§impl<W: Write> AnsiBackend<W>
impl<W: Write> AnsiBackend<W>
Trait Implementations§
Source§impl<W: Write> Backend for AnsiBackend<W>
impl<W: Write> Backend for AnsiBackend<W>
Source§fn draw<'a, I>(&mut self, content: I) -> Result<(), Self::Error>
fn draw<'a, I>(&mut self, content: I) -> Result<(), Self::Error>
Draw the given content to the terminal screen. Read more
Source§fn hide_cursor(&mut self) -> Result<(), Self::Error>
fn hide_cursor(&mut self) -> Result<(), Self::Error>
Hide the cursor on the terminal screen. Read more
Source§fn show_cursor(&mut self) -> Result<(), Self::Error>
fn show_cursor(&mut self) -> Result<(), Self::Error>
Show the cursor on the terminal screen. Read more
Source§fn get_cursor_position(&mut self) -> Result<Position, Self::Error>
fn get_cursor_position(&mut self) -> Result<Position, Self::Error>
Get the current cursor position on the terminal screen. Read more
Source§fn set_cursor_position<P: Into<Position>>(
&mut self,
position: P,
) -> Result<(), Self::Error>
fn set_cursor_position<P: Into<Position>>( &mut self, position: P, ) -> Result<(), Self::Error>
Set the cursor position on the terminal screen to the given x and y coordinates. Read more
Source§fn clear_region(&mut self, clear_type: ClearType) -> Result<(), Self::Error>
fn clear_region(&mut self, clear_type: ClearType) -> Result<(), Self::Error>
Clears a specific region of the terminal specified by the [
ClearType] parameter Read moreSource§fn size(&self) -> Result<Size, Self::Error>
fn size(&self) -> Result<Size, Self::Error>
Get the size of the terminal screen in columns/rows as a [
Size]. Read moreSource§fn window_size(&mut self) -> Result<WindowSize, Self::Error>
fn window_size(&mut self) -> Result<WindowSize, Self::Error>
Get the size of the terminal screen in columns/rows and pixels as a [
WindowSize]. Read moreSource§fn flush(&mut self) -> Result<(), Self::Error>
fn flush(&mut self) -> Result<(), Self::Error>
Flush any buffered content to the terminal screen.
§fn append_lines(&mut self, _n: u16) -> Result<(), Self::Error>
fn append_lines(&mut self, _n: u16) -> Result<(), Self::Error>
Insert
n line breaks to the terminal screen. Read moreAuto Trait Implementations§
impl<W> Freeze for AnsiBackend<W>where
W: Freeze,
impl<W> RefUnwindSafe for AnsiBackend<W>where
W: RefUnwindSafe,
impl<W> Send for AnsiBackend<W>where
W: Send,
impl<W> Sync for AnsiBackend<W>where
W: Sync,
impl<W> Unpin for AnsiBackend<W>where
W: Unpin,
impl<W> UnsafeUnpin for AnsiBackend<W>where
W: UnsafeUnpin,
impl<W> UnwindSafe for AnsiBackend<W>where
W: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more