pub struct CheckboxStates {
pub choice: usize,
pub choices: Vec<String>,
pub selection: Vec<usize>,
}
Expand description
§CheckboxStates
CheckboxStates contains states for this component
Fields§
§choice: usize
§choices: Vec<String>
§selection: Vec<usize>
Implementations§
Source§impl CheckboxStates
impl CheckboxStates
Sourcepub fn next_choice(&mut self, rewind: bool)
pub fn next_choice(&mut self, rewind: bool)
§next_choice
Move choice index to next choice
Sourcepub fn prev_choice(&mut self, rewind: bool)
pub fn prev_choice(&mut self, rewind: bool)
§prev_choice
Move choice index to previous choice
pub fn select(&mut self, i: usize)
Sourcepub fn set_choices(&mut self, choices: &[String])
pub fn set_choices(&mut self, choices: &[String])
§set_choices
Set CheckboxStates choices from a vector of str 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 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