pub struct Menu { /* private fields */ }
Expand description
Menu system for terminal interface
Implementations§
Source§impl Menu
impl Menu
Sourcepub fn show(&mut self, input_handler: &mut InputHandler) -> Result<usize>
pub fn show(&mut self, input_handler: &mut InputHandler) -> Result<usize>
Display the menu and get user selection
Sourcepub fn set_selected(&mut self, index: usize)
pub fn set_selected(&mut self, index: usize)
Set the selected index
Sourcepub fn get_selected(&self) -> usize
pub fn get_selected(&self) -> usize
Get the selected index
Sourcepub fn remove_item(&mut self, index: usize) -> Option<String>
pub fn remove_item(&mut self, index: usize) -> Option<String>
Remove an item from the menu
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Menu
impl RefUnwindSafe for Menu
impl Send for Menu
impl Sync for Menu
impl Unpin for Menu
impl UnwindSafe for Menu
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
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