Struct tui_menu::MenuItem

source ·
pub struct MenuItem<T> {
    pub data: Option<T>,
    /* private fields */
}
Expand description

MenuItem is the node in menu tree. If children is not empty, then this item is the group item.

Fields§

§data: Option<T>

Implementations§

helper function to create an non group item.

helper function to create a group item.

Example
use tui_menu::MenuItem;

let item = MenuItem::<&'static str>::group("group", vec![
    MenuItem::item("foo", "label_foo"),
]);

assert!(item.is_group());

whether this item is group

return deepest highlight item’s reference

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.