pub struct MenuItem {
pub id: u64,
pub label: String,
pub role: MenuItemRole,
pub accelerator: Option<MenuAccelerator>,
pub enabled: bool,
pub checked: bool,
pub is_separator: bool,
pub submenu: Option<Menu>,
}Expand description
An individual item in an application menu.
Fields§
§id: u64§label: String§role: MenuItemRole§accelerator: Option<MenuAccelerator>§enabled: bool§checked: bool§is_separator: boolImplementations§
Source§impl MenuItem
impl MenuItem
pub fn item(id: u64, label: impl Into<String>) -> Self
pub fn role(role: MenuItemRole) -> Self
pub fn separator() -> Self
pub fn with_accelerator(self, acc: impl Into<String>) -> Self
pub fn with_enabled(self, enabled: bool) -> Self
pub fn with_checked(self, checked: bool) -> Self
Trait Implementations§
impl StructuralPartialEq for MenuItem
Auto Trait Implementations§
impl Forget for MenuItem
impl Freeze for MenuItem
impl Move 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§
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