Trait requestty_ui::backend::Backend [−][src]
pub trait Backend: Write {}Show 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
fn enable_raw_mode(&mut self) -> Result<()>
fn enable_raw_mode(&mut self) -> Result<()>Enables raw mode.
fn disable_raw_mode(&mut self) -> Result<()>
fn disable_raw_mode(&mut self) -> Result<()>Disables raw mode.
fn hide_cursor(&mut self) -> Result<()>
fn hide_cursor(&mut self) -> Result<()>Hides the cursor.
fn show_cursor(&mut self) -> Result<()>
fn show_cursor(&mut self) -> Result<()>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.
fn set_attributes(&mut self, attributes: Attributes) -> Result<()>
fn set_attributes(&mut self, attributes: Attributes) -> Result<()>Sets the given attributes removing ones which were previous applied.
Provided methods
fn move_cursor(&mut self, direction: MoveDirection) -> Result<()>
fn move_cursor(&mut self, direction: MoveDirection) -> Result<()>Moves the cursor relative to the current position as per the direction.