pub struct Menu<'a> {
    pub name: &'a str,
    pub exp: Option<&'a str>,
    pub items: Vec<Item<'a>>,
    pub esc: bool,
}
Expand description

Starting point for creating a menu instance.

Fields

name: &'a str

Menu name is displayed at the top.

exp: Option<&'a str>

Optional explanation in gray color next to the menu name.

items: Vec<Item<'a>>

Menu items should be vector of Items.

esc: bool

Enable exiting menu by Esc hotkey. Usually set it to true. But it may be useful to set to false when you want to restrict the user from escaping without any selection.

Implementations

Prints out Items, executes the Menu and returns Result.

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 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.