Enum cursive::menu::MenuItem
[−]
[src]
pub enum MenuItem { Leaf(String, Callback), Subtree(String, Rc<MenuTree>), Delimiter, }
Node in the menu tree.
Variants
Leaf(String, Callback)
Actionnable button with a label.
Subtree(String, Rc<MenuTree>)
Sub-menu with a label.
Delimiter
Delimiter without a label.
Methods
impl MenuItem
[src]
pub fn label(&self) -> &str
[src]
Returns the label for this item.
Returns an empty string if self
is a delimiter.
pub fn is_delimiter(&self) -> bool
[src]
Returns true
if self
is a delimiter.
pub fn is_leaf(&self) -> bool
[src]
Returns true
if self
is a leaf node.
pub fn is_subtree(&self) -> bool
[src]
Returns true
if self
is a subtree.
pub fn as_subtree(&mut self) -> Option<&mut MenuTree>
[src]
Return a mutable reference to the subtree, if applicable.
Returns None
if self
is not a MenuItem::Subtree
.