Enum requestty::question::Choice[][src]

pub enum Choice<T> {
    Choice(T),
    Separator(String),
    DefaultSeparator,
}
Expand description

A possible choice in a list.

Variants

Choice(T)

The main variant which represents a choice the user can pick from.

Tuple Fields of Choice

0: T
Separator(String)

A separator is a single line of text that can be used to annotate other choices. It is not selectable and is skipped over when users navigate.

If the text is more than one line, it will be cut-off.

Tuple Fields of Separator

0: String
DefaultSeparator

A separator which prints a line: “──────────────”

Implementations

Maps an Choice<T> to Choice<U> by applying a function to the contained Choice::Choice if any.

Returns true if the choice is a Choice::Choice.

Returns true if the choice is a separator.

Converts &Choice<T> to Choice<&T>.

This will clone the Choice::Separator if any.

Converts &mut Choice<T> to Choice<&mut T>.

This will clone the Choice::Separator if any.

Returns the contained Choice::Choice value, consuming self.

Panics

This will panic if self is not a Choice::Choice.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

Performs the conversion.

Performs the conversion.

This will panic if called

Render to a given backend. Read more

The number of rows of the terminal the widget will take when rendered. Read more

Handle a key input. It should return whether key was handled.

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

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.