Trait requestty::prompt::Backend [−][src]
pub trait Backend: Write {
Show 14 methods
fn enable_raw_mode(&mut self) -> Result<(), Error>;
fn disable_raw_mode(&mut self) -> Result<(), Error>;
fn hide_cursor(&mut self) -> Result<(), Error>;
fn show_cursor(&mut self) -> Result<(), Error>;
fn get_cursor_pos(&mut self) -> Result<(u16, u16), Error>;
fn move_cursor_to(&mut self, x: u16, y: u16) -> Result<(), Error>;
fn scroll(&mut self, dist: i16) -> Result<(), Error>;
fn set_attributes(&mut self, attributes: Attributes) -> Result<(), Error>;
fn set_fg(&mut self, color: Color) -> Result<(), Error>;
fn set_bg(&mut self, color: Color) -> Result<(), Error>;
fn clear(&mut self, clear_type: ClearType) -> Result<(), Error>;
fn size(&self) -> Result<Size, Error>;
fn move_cursor(&mut self, direction: MoveDirection) -> Result<(), Error> { ... }
fn write_styled(
&mut self,
styled: &Styled<dyn Display>
) -> Result<(), Error> { ... }
}Expand description
A trait to represent a terminal that can be rendered to.
Required methods
fn enable_raw_mode(&mut self) -> Result<(), Error>
fn enable_raw_mode(&mut self) -> Result<(), Error>
Enables raw mode.
fn disable_raw_mode(&mut self) -> Result<(), Error>
fn disable_raw_mode(&mut self) -> Result<(), Error>
Disables raw mode.
fn hide_cursor(&mut self) -> Result<(), Error>
fn hide_cursor(&mut self) -> Result<(), Error>
Hides the cursor.
fn show_cursor(&mut self) -> Result<(), Error>
fn show_cursor(&mut self) -> Result<(), Error>
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<(), Error>
fn set_attributes(&mut self, attributes: Attributes) -> Result<(), Error>
Sets the given attributes removing ones which were previous applied.
Clears the cells given by clear_type
Provided methods
fn move_cursor(&mut self, direction: MoveDirection) -> Result<(), Error>
fn move_cursor(&mut self, direction: MoveDirection) -> Result<(), Error>
Moves the cursor relative to the current position as per the direction.