pub trait Backend: Write {
Show 14 methods fn enable_raw_mode(&mut self) -> Result<()>; fn disable_raw_mode(&mut self) -> Result<()>; fn hide_cursor(&mut self) -> Result<()>; fn show_cursor(&mut self) -> Result<()>; fn get_cursor_pos(&mut self) -> Result<(u16, u16)>; fn move_cursor_to(&mut self, x: u16, y: u16) -> Result<()>; fn scroll(&mut self, dist: i16) -> Result<()>; fn set_attributes(&mut self, attributes: Attributes) -> Result<()>; fn set_fg(&mut self, color: Color) -> Result<()>; fn set_bg(&mut self, color: Color) -> Result<()>; fn clear(&mut self, clear_type: ClearType) -> Result<()>; fn size(&self) -> Result<Size>; fn move_cursor(&mut self, direction: MoveDirection) -> Result<()> { ... } fn write_styled(&mut self, styled: &Styled<dyn Display>) -> Result<()> { ... }
}
Expand description

A trait to represent a terminal that can be rendered to.

Required Methods

Enables raw mode.

Disables raw mode.

Hides the cursor.

Shows the cursor.

Gets the cursor position as (col, row). The top-left cell is (0, 0).

Moves the cursor to given position. The top-left cell is (0, 0).

Scrolls the terminal the given number of rows.

A negative number means the terminal scrolls upwards, while a positive number means the terminal scrolls downwards.

Sets the given attributes removing ones which were previous applied.

Sets the foreground color.

Sets the background color.

Clears the cells given by clear_type

Gets the size of the terminal in rows and columns.

Provided Methods

Moves the cursor relative to the current position as per the direction.

Write a styled object to the backend.

See also Styled and Stylize.

Implementations on Foreign Types

Implementors