pub struct Select<L> {
    pub list: L,
    /* private fields */
}
Expand description

A widget to select a single item from a list.

The list must implement the List trait.

Fields

list: L

The underlying list

Implementations

Creates a new Select.

Panics

Panics if there are no selectable items, or if list.page_size() is less than 5.

The index of the element that is currently being hovered.

Set the index of the element that is currently being hovered.

at can be any number (even beyond list.len()), but the caller is responsible for making sure that it is a selectable element.

Consumes the Select returning the original list.

Returns a reference to the currently hovered item.

Returns a mutable reference to the currently hovered item.

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

Returns the starting location of the layout. It should not be relied upon for a sensible cursor position.

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

Render to a given backend. Read more

The number of rows of the terminal the widget will take when rendered. 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 resulting type after obtaining ownership.

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

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.