Trait mortal::unix::TerminalExt

source ·
pub trait TerminalExt: Private {
    // Required method
    fn read_raw(
        &mut self,
        buf: &mut [u8],
        timeout: Option<Duration>
    ) -> Result<Option<Event>>;
}
Expand description

Implements Unix-only extensions for terminal interfaces.

Required Methods§

source

fn read_raw( &mut self, buf: &mut [u8], timeout: Option<Duration> ) -> Result<Option<Event>>

Reads raw data from the terminal.

Data read will be UTF-8 encoded, but may be incomplete. The caller may consume any valid UTF-8 data before performing another read_raw call to complete previously read data.

If timeout elapses without an event occurring, this method will return Ok(None). If timeout is None, this method will wait indefinitely.

Implementors§