[][src]Trait cmdtree::completion::Terminal

pub trait Terminal: Send + Sync {
    type PrepareState;
    fn name(&self) -> &str;
fn lock_read(&'a self) -> Box<dyn TerminalReader<Self> + 'a>;
fn lock_write(&'a self) -> Box<dyn TerminalWriter<Self> + 'a>; }

Defines a low-level interface to the terminal

Associated Types

type PrepareState

Returned by prepare; passed to restore to restore state.

Loading content...

Required methods

fn name(&self) -> &str

Returns the name of the terminal.

fn lock_read(&'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.

fn lock_write(&'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.

Loading content...

Implementations on Foreign Types

impl Terminal for MemoryTerminal[src]

type PrepareState = ()

impl Terminal for DefaultTerminal[src]

type PrepareState = PrepareState

Loading content...

Implementors

Loading content...