Struct mortal::terminal::TerminalReadGuard[][src]

pub struct TerminalReadGuard<'a>(_);

Holds an exclusive lock for read operations on a Terminal

See Terminal documentation for details on locking.

Methods

impl<'a> TerminalReadGuard<'a>
[src]

Prepares the terminal to read input.

When reading operations have concluded, restore should be called with the resulting PrepareState value to restore the terminal to its previous state.

This method may be called more than once before a corresponding restore call. However, each restore call must receive the most recently created PrepareState value.

See PrepareConfig for details.

Locking

This method internally acquires the Terminal write lock.

If the write lock is already held by the current thread, call prepare_with_lock, in order to prevent deadlocks.

Performs terminal preparation using both Terminal locks.

Restores the terminal to its previous state.

Locking

This method internally acquires the Terminal write lock.

If the write lock is already held by the current thread, call restore_with_lock, in order to prevent deadlocks.

Performs terminal state restoration using both Terminal locks.

Waits for an event from the terminal.

Returns Ok(false) if timeout elapses without an event occurring.

If timeout is None, this method will wait indefinitely.

Waits for input and reads an event from the terminal.

Returns Ok(None) if timeout elapses without an event occurring.

If timeout is None, this method will wait indefinitely.

Trait Implementations

impl<'a> TerminalExt for TerminalReadGuard<'a>
[src]

Reads raw data from the terminal. Read more

Auto Trait Implementations

impl<'a> !Send for TerminalReadGuard<'a>

impl<'a> Sync for TerminalReadGuard<'a>