pub enum MenuItem<'a, T> {
Item {
content: Node<'a, T>,
on_select: Option<T>,
},
Menu {
content: Node<'a, T>,
items: Vec<MenuItem<'a, T>>,
},
}
Expand description
An item in Menu
.
Variants§
Implementations§
Source§impl<'a, T: 'a> MenuItem<'a, T>
impl<'a, T: 'a> MenuItem<'a, T>
Sourcepub fn item(
content: impl IntoNode<'a, T>,
on_select: impl Into<Option<T>>,
) -> Self
pub fn item( content: impl IntoNode<'a, T>, on_select: impl Into<Option<T>>, ) -> Self
Construct a new MenuItem
of the item type,
with a content node and a message to be posted when this item is selected.
Construct a new MenuItem
of the sub menu type,
with a content node. Sub menu items can be added to the returned value.
Sourcepub fn push(self, item: Self) -> Self
pub fn push(self, item: Self) -> Self
Adds a sub MenuItem
to this menu.
Will panic if this is an item instead of a submenu.
Sourcepub fn extend(self, new_items: impl IntoIterator<Item = Self>) -> Self
pub fn extend(self, new_items: impl IntoIterator<Item = Self>) -> Self
Adds multiple sub MenuItem
s to this menu.
Will panic if this is an item instead of a submenu.
Auto Trait Implementations§
impl<'a, T> Freeze for MenuItem<'a, T>where
T: Freeze,
impl<'a, T> !RefUnwindSafe for MenuItem<'a, T>
impl<'a, T> Send for MenuItem<'a, T>where
T: Send,
impl<'a, T> !Sync for MenuItem<'a, T>
impl<'a, T> Unpin for MenuItem<'a, T>where
T: Unpin,
impl<'a, T> !UnwindSafe for MenuItem<'a, T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more