Struct prototty::Menu

source ·
pub struct Menu<T>where
    T: Copy,
{ pub entries: Vec<MenuEntry<T>, Global>, pub size: Size, pub selected_info: TextInfo, pub normal_info: TextInfo, }
Expand description

A list of MenuEntrys, in the order they appear when rendered, with a description of how the text of the selected and normal (ie. not selected) entries should be rendered.

Menus (MenuEntrys rather) own their value, and remain in scope after a value has been chosen (by running the menu). A copy of a MenuEntry’s value is returned by MenuRunner::run_menu.

Note that a Menu doesn’t contain information about the current selection. When a Menu is rendered, all its entries use normal_info when rendering. To combine a Menu with selection state, use a MenuInstance.

Fields

entries: Vec<MenuEntry<T>, Global>size: Sizeselected_info: TextInfonormal_info: TextInfo

Implementations

Create a new menu.

Create a new menu, occupying the smallest amount of space required to fit all entries.

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

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.