pub trait Terminal {
// Required methods
fn write(&mut self, bytes: &[u8]) -> Result<()>;
fn read(
&mut self,
buf: &mut [u8],
timeout: Option<Duration>,
) -> Result<Option<usize>>;
// Provided methods
fn restore(&mut self) -> Result<()> { ... }
fn modes(&mut self, _paste: bool, _kitty: bool) { ... }
fn waker(&self) -> Option<Waker> { ... }
}Expand description
A byte stream to a terminal with a timed read.
Required Methods§
Provided Methods§
Sourcefn restore(&mut self) -> Result<()>
fn restore(&mut self) -> Result<()>
Puts the terminal back as it was (leaves raw mode). Called once, when the session closes or fails to connect.
§Errors
When the terminal can’t be restored.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".