Trait termit::Control

source ·
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;
}
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§

source

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

Enable raw terminal mode to receive ANSI input

source

fn get_size(&self) -> Result<Point>

Get terminal window size

source

fn is_tty(&self) -> bool

Check if it’s a tty

source

fn is_raw(&self) -> bool

Check it it’s been switched to raw

source

fn is_ansi(&self) -> bool

Check if the control supports ANSI

source

fn output(&self) -> &File

source

fn input(&self) -> &File

source

fn clone(&self) -> Selfwhere Self: Sized,

Implementations on Foreign Types§

source§

impl<T> Control for &Twhere T: Control + ?Sized,

source§

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

source§

fn get_size(&self) -> Result<Point>

source§

fn is_tty(&self) -> bool

source§

fn is_raw(&self) -> bool

source§

fn is_ansi(&self) -> bool

source§

fn output(&self) -> &File

source§

fn input(&self) -> &File

source§

fn clone(&self) -> Selfwhere Self: Sized,

Implementors§