Struct console_menu::MenuOption
source · pub struct MenuOption {
pub label: String,
pub action: Box<dyn FnMut()>,
}
Expand description
An element in a Menu
.
Consists of a label and a callback. Callbacks can be any function, including functions that call nested menus:
let mut nested_menu = Menu::new(vec![], MenuProps::default());
let show_nested = MenuOption::new("show nested menu", move || nested_menu.show());
Fields§
§label: String
§action: Box<dyn FnMut()>
Implementations§
Trait Implementations§
source§impl Default for MenuOption
impl Default for MenuOption
MenuOption::new("exit", || {})
source§fn default() -> MenuOption
fn default() -> MenuOption
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for MenuOption
impl !Send for MenuOption
impl !Sync for MenuOption
impl Unpin for MenuOption
impl !UnwindSafe 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