Skip to main content

Device

Trait Device 

Source
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§

Source

fn get_terminal_size(&mut self) -> Result<Vector>

Retrieve the device’s terminal viewport size.

Source

fn enable_raw_mode(&mut self) -> Result<()>

Enable “raw mode” in the terminal.

Source

fn disable_raw_mode(&mut self) -> Result<()>

Restore the configuration before the terminal was placed in “raw mode”.

Source

fn get_cursor_position(&mut self) -> Result<Position>

Retrieve the cursor’s absolute position in the device’s buffer.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Device for Stdout

Implementors§