pub struct MenuOption { /* private fields */ }Expand description
A option that can be added to a Menu.
Implementations§
Source§impl MenuOption
impl MenuOption
Sourcepub fn new<F>(label: &str, func: F) -> MenuOptionwhere
F: FnMut() + 'static,
pub fn new<F>(label: &str, func: F) -> MenuOptionwhere
F: FnMut() + 'static,
Creates a new Menu option that can then be used by a Menu.
§Example
fn action_example() {}
let menu_option = MenuOption::new("Option example", action_example);Sourcepub fn hint(self, text: &str) -> MenuOption
pub fn hint(self, text: &str) -> MenuOption
Sets the hint label with the given text.
§Example
fn action_1() {}
let menu_option_1 = MenuOption::new("Option 1", action_1).hint("Hint example");Auto Trait Implementations§
impl !RefUnwindSafe for MenuOption
impl !Send for MenuOption
impl !Sync for MenuOption
impl !UnwindSafe for MenuOption
impl Freeze for MenuOption
impl Unpin for MenuOption
impl UnsafeUnpin for MenuOption
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