pub struct MenuItem<'ui, Label, Shortcut = &'static str> { /* private fields */ }
Expand description
Builder for a menu item.
Implementations§
source§impl<'ui, Label: AsRef<str>, Shortcut: AsRef<str>> MenuItem<'ui, Label, Shortcut>
impl<'ui, Label: AsRef<str>, Shortcut: AsRef<str>> MenuItem<'ui, Label, Shortcut>
sourcepub fn shortcut<Shortcut2: AsRef<str>>(
self,
shortcut: Shortcut2
) -> MenuItem<'ui, Label, Shortcut2>
pub fn shortcut<Shortcut2: AsRef<str>>( self, shortcut: Shortcut2 ) -> MenuItem<'ui, Label, Shortcut2>
Sets the menu item shortcut.
Shortcuts are displayed for convenience only and are not automatically handled.
sourcepub fn selected(self, selected: bool) -> Self
pub fn selected(self, selected: bool) -> Self
Sets the selected state of the menu item.
Default: false
sourcepub fn build_with_ref(self, selected: &mut bool) -> bool
pub fn build_with_ref(self, selected: &mut bool) -> bool
Builds the menu item using a mutable reference to selected state.
Trait Implementations§
impl<'ui, Label: Copy, Shortcut: Copy> Copy for MenuItem<'ui, Label, Shortcut>
Auto Trait Implementations§
impl<'ui, Label, Shortcut> Freeze for MenuItem<'ui, Label, Shortcut>
impl<'ui, Label, Shortcut = &'static str> !RefUnwindSafe for MenuItem<'ui, Label, Shortcut>
impl<'ui, Label, Shortcut = &'static str> !Send for MenuItem<'ui, Label, Shortcut>
impl<'ui, Label, Shortcut = &'static str> !Sync for MenuItem<'ui, Label, Shortcut>
impl<'ui, Label, Shortcut> Unpin for MenuItem<'ui, Label, Shortcut>
impl<'ui, Label, Shortcut = &'static str> !UnwindSafe for MenuItem<'ui, Label, Shortcut>
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