pub struct MenuItem<'a> {
pub id: usize,
pub label: String,
pub enabled: bool,
pub key: Key,
pub modifier: usize,
/* private fields */
}
Expand description
Holds info about each item in a menu
Fields
id: usize
label: String
enabled: bool
key: Key
modifier: usize
Implementations
sourceimpl<'a> MenuItem<'a>
impl<'a> MenuItem<'a>
sourcepub fn shortcut(self, key: Key, modifier: usize) -> Self
pub fn shortcut(self, key: Key, modifier: usize) -> Self
Sets a shortcut key and modifer (and returns itself)
Examples
menu.add_item("test", 1).shortcut(Key::A, 0).build()
sourcepub fn separator(self) -> Self
pub fn separator(self) -> Self
Sets item to a separator
Examples
menu.add_item("", 0).separator().build()
Notice that it’s usually easier to just call menu.add_separator()
directly
Trait Implementations
Auto Trait Implementations
impl<'a> RefUnwindSafe for MenuItem<'a>
impl<'a> Send for MenuItem<'a>
impl<'a> Sync for MenuItem<'a>
impl<'a> Unpin for MenuItem<'a>
impl<'a> !UnwindSafe for MenuItem<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more