pub struct CheckboxStates {
pub choice: usize,
pub choices: Vec<String>,
pub selection: Vec<usize>,
}Expand description
The state that needs to be kept for Checkbox.
Fields§
§choice: usizeCurrent hover option.
choices: Vec<String>Available choices.
selection: Vec<usize>Enabled options.
Implementations§
Source§impl CheckboxStates
impl CheckboxStates
Sourcepub fn next_choice(&mut self, rewind: bool)
pub fn next_choice(&mut self, rewind: bool)
Move choice index to next choice.
Sourcepub fn prev_choice(&mut self, rewind: bool)
pub fn prev_choice(&mut self, rewind: bool)
Move choice index to previous choice.
Sourcepub fn set_choices(&mut self, choices: impl Into<Vec<String>>)
pub fn set_choices(&mut self, choices: impl Into<Vec<String>>)
Overwrite the choices available with new ones.
In addition resets current selection and keep index if possible or set it to the first value available.
Trait Implementations§
Source§impl Default for CheckboxStates
impl Default for CheckboxStates
Source§fn default() -> CheckboxStates
fn default() -> CheckboxStates
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CheckboxStates
impl RefUnwindSafe for CheckboxStates
impl Send for CheckboxStates
impl Sync for CheckboxStates
impl Unpin for CheckboxStates
impl UnsafeUnpin for CheckboxStates
impl UnwindSafe for CheckboxStates
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