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

An option selection field.

Examples

use tty_interface::Style;

use tty_form::{
    step::CompoundStep,
    control::{Control, SelectInput},
};

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(&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.
This control’s descriptive help text, if available.
This control’s rendered contents and an optional offset for the cursor.
This control’s drawer contents, if available.
This control’s dependency evaluation which other controls may react to.
This control’s dependency which it may react to.
Perform an evaluation against this control’s current state.
Finish configuration and add this control to the specified form step.

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.