Skip to main content

TermOut

Trait TermOut 

Source
pub trait TermOut: Write {
    // Required methods
    fn size(&mut self) -> Result<(u16, u16)>;
    fn cursor_position(&mut self) -> Result<(u16, u16)>;
    fn enable_raw_mode(&mut self) -> Result<()>;
    fn disable_raw_mode(&mut self) -> Result<()>;
}
Expand description

Output half of a terminal: an ANSI escape-sequence sink plus the small set of queries and mode switches the TUI needs.

Writes may be buffered; implementations must apply all previously written bytes when Write::flush is called.

Required Methods§

Source

fn size(&mut self) -> Result<(u16, u16)>

Current terminal size as (cols, rows).

Source

fn cursor_position(&mut self) -> Result<(u16, u16)>

Current cursor position as (col, row), zero-based.

Implementations must flush pending output before answering so the reported position reflects every previous write.

Source

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

Source

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

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§