pub struct Input<P, B: Backend> { /* private fields */ }
Expand description

A ui runner which implements the render cycle.

It renders and processes events with the help of a type that implements Prompt.

See run for more information

Implementations

Creates a new Input. This won’t do anything until it is run.

Hides the cursor while running the input. This won’t do anything until it is run.

What to do after receiving a Esc.

For OnEsc::Terminate - an Error::Aborted will be returned. For OnEsc::SkipQuestion - the currently shown prompt will be cleared, and Ok(None) will be returned. For OnEsc::Ignore - no special behaviour will be applied to the Esc key. Like other keys, the Esc key will be passed to the prompt to handle.

Display the prompt and process events until the user presses Enter.

After the user presses Enter, validate will be called.

Trait Implementations

Formats the value using the given formatter. 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.