pub trait Device: Write {
// Required methods
fn get_terminal_size(&mut self) -> Result<Vector>;
fn enable_raw_mode(&mut self) -> Result<()>;
fn disable_raw_mode(&mut self) -> Result<()>;
fn get_cursor_position(&mut self) -> Result<Position>;
}
Expand description
An output device to be controlled for displaying an interface.
Required Methods§
Sourcefn get_terminal_size(&mut self) -> Result<Vector>
fn get_terminal_size(&mut self) -> Result<Vector>
Retrieve the device’s terminal viewport size.
Sourcefn enable_raw_mode(&mut self) -> Result<()>
fn enable_raw_mode(&mut self) -> Result<()>
Enable “raw mode” in the terminal.
Sourcefn disable_raw_mode(&mut self) -> Result<()>
fn disable_raw_mode(&mut self) -> Result<()>
Restore the configuration before the terminal was placed in “raw mode”.
Sourcefn get_cursor_position(&mut self) -> Result<Position>
fn get_cursor_position(&mut self) -> Result<Position>
Retrieve the cursor’s absolute position in the device’s buffer.