pub struct MultipleChoiceMenu<T: Clone> {
pub title: String,
pub options: SelectableList<MenuOption<T>>,
pub has_save_button: bool,
pub is_on_save_button: bool,
}
Expand description
A menu with multiple choice options and a save button
Fields§
§title: String
§options: SelectableList<MenuOption<T>>
Implementations§
Source§impl<T: Clone> MultipleChoiceMenu<T>
impl<T: Clone> MultipleChoiceMenu<T>
pub fn new(title: String, options: Vec<MenuOption<T>>) -> Self
Sourcepub fn toggle_selected(&mut self)
pub fn toggle_selected(&mut self)
Toggle the currently selected option
Sourcepub fn is_save_selected(&self) -> bool
pub fn is_save_selected(&self) -> bool
Checks if the save button is selected
Sourcepub fn get_selected_values(&self) -> Vec<T>
pub fn get_selected_values(&self) -> Vec<T>
Returns a list of all selected values
Sourcepub fn handle_input(&mut self, event: &Event) -> bool
pub fn handle_input(&mut self, event: &Event) -> bool
Handle user input from the menu
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for MultipleChoiceMenu<T>
impl<T> RefUnwindSafe for MultipleChoiceMenu<T>where
T: RefUnwindSafe,
impl<T> Send for MultipleChoiceMenu<T>where
T: Send,
impl<T> Sync for MultipleChoiceMenu<T>where
T: Sync,
impl<T> Unpin for MultipleChoiceMenu<T>where
T: Unpin,
impl<T> UnwindSafe for MultipleChoiceMenu<T>where
T: UnwindSafe,
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