pub struct SelectInput { /* private fields */ }
Expand description

An option selection field.

Examples

use tty_form::{CompoundStep, Control, SelectInput};
use tty_interface::Style;

let mut step = CompoundStep::new();
SelectInput::new("Select favorite food:", vec![
    ("Pizza", "A supreme pizza."),
    ("Burgers", "A hamburger with cheese."),
    ("Fries", "Simple potato french-fries."),
]).add_to_step(&mut step);

Implementations

Create a new option-selection input with the specified prompt and options.

Update this input’s prompt text.

Add an option to this input’s list.

Set this input’s options.

Trait Implementations

Whether this control is a focusable input.
Updates the control’s state from the given input event.
Get this control’s descriptive help text, if available.
Get this control’s rendered result contents.
Get this control’s drawer contents, if available.
Finish configuration and add this control to the specified form step.

Create a new option-selection input with no options.

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.