Enum cursive::menu::Item [−][src]
pub enum Item {
Leaf {
label: String,
cb: Callback,
enabled: bool,
},
Subtree {
label: String,
tree: Rc<Tree>,
enabled: bool,
},
Delimiter,
}
Expand description
Node in the menu tree.
Variants
Leaf
Fields
label: String
Text displayed for this entry.
cb: Callback
Callback to run when the entry is selected.
enabled: bool
Whether this item is enabled.
Disabled items cannot be selected and are displayed grayed out.
Actionnable button with a label.
Subtree
Fields
label: String
Text displayed for this entry.
enabled: bool
Whether this item is enabled.
Disabled items cannot be selected and are displayed grayed out.
Sub-menu with a label.
Delimiter
Delimiter without a label.
Implementations
Create a new leaf menu item.
Create a new subtree menu item.
Returns the label for this item.
Returns a vertical bar string if self
is a delimiter.
Returns true if this item is enabled.
Only labels and subtrees can be enabled. Delimiters
Disable this item.
Disabled items cannot be selected and are shown grayed out.
Does not affect delimiters.
Returns true
if self
is a delimiter.
Returns true
if self
is a subtree.
Return a mutable reference to the subtree, if applicable.
Returns None
if self
is not a Item::Subtree
.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Item
impl !UnwindSafe for Item
Blanket Implementations
Mutably borrows from an owned value. Read more
Calls the given closure and return the result. Read more
Calls the given closure on self
.