[][src]Enum cursive::menu::MenuItem

pub enum MenuItem {
    Leaf(StringCallback),
    Subtree(StringRc<MenuTree>),
    Delimiter,
}

Node in the menu tree.

Variants

Leaf(StringCallback)

Actionnable button with a label.

Subtree(StringRc<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.

Trait Implementations

impl Clone for MenuItem[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl Unpin for MenuItem

impl !Sync for MenuItem

impl !Send for MenuItem

impl !UnwindSafe for MenuItem

impl !RefUnwindSafe for MenuItem

Blanket Implementations

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T[src]