termion::input

Trait TermRead

Source
pub trait TermRead {
    // Required methods
    fn events(self) -> Events<Self> 
       where Self: Sized;
    fn keys(self) -> Keys<Self> 
       where Self: Sized;
    fn read_line(&mut self) -> Result<Option<String>>;

    // Provided method
    fn read_passwd<W: Write>(
        &mut self,
        writer: &mut W,
    ) -> Result<Option<String>> { ... }
}
Expand description

Extension to Read trait.

Required Methods§

Source

fn events(self) -> Events<Self>
where Self: Sized,

An iterator over input events.

Source

fn keys(self) -> Keys<Self>
where Self: Sized,

An iterator over key inputs.

Source

fn read_line(&mut self) -> Result<Option<String>>

Read a line.

EOT and ETX will abort the prompt, returning None. Newline or carriage return will complete the input.

Provided Methods§

Source

fn read_passwd<W: Write>(&mut self, writer: &mut W) -> Result<Option<String>>

Read a password.

EOT and ETX will abort the prompt, returning None. Newline or carriage return will complete the input.

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§