pub struct ContextMenuSubmenu<C> { /* private fields */ }Expand description
A submenu that groups context-menu items under a shared label.
Implementations§
Sourcepub fn new(label: impl Into<String>) -> Self
pub fn new(label: impl Into<String>) -> Self
Creates an empty submenu with the given display label.
Sourcepub fn with_children(self, children: &mut Vec<ContextMenuNode<C>>) -> Self
pub fn with_children(self, children: &mut Vec<ContextMenuNode<C>>) -> Self
Appends all nodes from children, draining the provided vec.
Sourcepub fn with_child(self, child: ContextMenuNode<C>) -> Self
pub fn with_child(self, child: ContextMenuNode<C>) -> Self
Appends a single child node (item or nested submenu).
Trait Implementations§
Source§fn from(submenu: ContextMenuSubmenu<C>) -> Self
fn from(submenu: ContextMenuSubmenu<C>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
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