pub struct TerminalReadGuard<'a>(_);
Expand description

Holds an exclusive lock for read operations on a Terminal

See Terminal documentation for details on locking.

Implementations

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

Reads raw data from the terminal. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.