pub trait Control {
// Required methods
fn enable_raw_mode(&self) -> Result<()>;
fn get_size(&self) -> Result<Point>;
fn is_tty(&self) -> bool;
fn is_raw(&self) -> bool;
fn is_ansi(&self) -> bool;
fn output(&self) -> &File;
fn input(&self) -> &File;
fn clone(&self) -> Self
where Self: Sized;
fn get_initial_style(&self) -> u16;
fn use_alternate_screen(&self, alternate: bool) -> Result<()>;
}
Expand description
Essentail part of a terminal application - controling the tty.
You could implement your own Control
for a specific system not covered here (unix/windows),
… and contribute. The implementations are target specific.
If you compile without the sys feature or on an unsupported system, you will get a dummy implementation when creating the default system terminal.
Required Methods§
sourcefn enable_raw_mode(&self) -> Result<()>
fn enable_raw_mode(&self) -> Result<()>
Enable raw terminal mode to receive ANSI input