pub trait Terminal: Send + Sync {
// Required methods
fn size(&self) -> Size;
fn next_key(&mut self) -> Option<KeyEvent>;
fn push_keys(&mut self, keys: &[KeyEvent]);
fn write(&mut self, bytes: &[u8]);
fn enter_alternate_screen(&mut self);
fn leave_alternate_screen(&mut self);
fn input_mode(&self) -> InputMode;
fn set_input_mode(&mut self, mode: InputMode);
fn flush(&mut self);
}Expand description
The interactive terminal facade consumed by interactive programs.
Implementations are pure virtual-terminal state; a host adapter feeds
KeyEvents in and renders the screen out.
Required Methods§
Sourcefn enter_alternate_screen(&mut self)
fn enter_alternate_screen(&mut self)
Enters the alternate screen buffer.
Sourcefn leave_alternate_screen(&mut self)
fn leave_alternate_screen(&mut self)
Leaves the alternate screen buffer, restoring the main screen.
Sourcefn input_mode(&self) -> InputMode
fn input_mode(&self) -> InputMode
The current input mode.
Sourcefn set_input_mode(&mut self, mode: InputMode)
fn set_input_mode(&mut self, mode: InputMode)
Sets the input mode.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".