Trait Terminal

Source
pub trait Terminal:
    Sized
    + Send
    + Sync {
    type PrepareState;

    // Required methods
    fn name(&self) -> &str;
    fn lock_read<'a>(&'a self) -> Box<dyn TerminalReader<Self> + 'a>;
    fn lock_write<'a>(&'a self) -> Box<dyn TerminalWriter<Self> + 'a>;
}
Expand description

Defines a low-level interface to the terminal

Required Associated Types§

Source

type PrepareState

Returned by prepare; passed to restore to restore state.

Required Methods§

Source

fn name(&self) -> &str

Returns the name of the terminal.

Source

fn lock_read<'a>(&'a self) -> Box<dyn TerminalReader<Self> + 'a>

Acquires a lock on terminal read operations and returns a value holding that lock and granting access to such operations.

The lock must not be released until the returned value is dropped.

Source

fn lock_write<'a>(&'a self) -> Box<dyn TerminalWriter<Self> + 'a>

Acquires a lock on terminal write operations and returns a value holding that lock and granting access to such operations.

The lock must not be released until the returned value is dropped.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§