pub enum MenuItem {
Action {
id: u64,
label: String,
shortcut: Option<Shortcut>,
enabled: bool,
role: Option<MenuRole>,
},
Submenu {
label: String,
items: Vec<MenuItem>,
role: Option<MenuBarRole>,
},
Separator,
}Expand description
One entry in a menu (recursive — a Submenu nests).
Variants§
Action
A command. id (nonzero) dispatches Event::MenuAction to the app; a role-only item uses
the native standard command instead (id 0). label/shortcut override the role’s defaults.
A nested submenu. At the TOP level of an app menu a role claims one of the platform’s
standard menu-bar slots: the backend then uses this menu instead of its stock one, and
places it where the platform expects that menu to sit.
Separator
A visual separator.
Trait Implementations§
impl StructuralPartialEq for MenuItem
Auto Trait Implementations§
impl Freeze for MenuItem
impl RefUnwindSafe for MenuItem
impl Send for MenuItem
impl Sync for MenuItem
impl Unpin for MenuItem
impl UnsafeUnpin for MenuItem
impl UnwindSafe for MenuItem
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more