pub struct SelectStates {
pub choices: Vec<String>,
pub selected: usize,
pub previously_selected: usize,
pub tab_open: bool,
}
Expand description
§SelectStates
Component states
Fields§
§choices: Vec<String>
Available choices
selected: usize
Currently selected choice
previously_selected: usize
Choice selected before opening the tab
tab_open: bool
Implementations§
Source§impl SelectStates
impl SelectStates
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
Sourcepub fn set_choices(&mut self, choices: &[String])
pub fn set_choices(&mut self, choices: &[String])
§set_choices
Set SelectStates choices from a vector of str In addition resets current selection and keep index if possible or set it to the first value available
pub fn select(&mut self, i: usize)
Sourcepub fn cancel_tab(&mut self)
pub fn cancel_tab(&mut self)
Cancel tab open
Sourcepub fn is_tab_open(&self) -> bool
pub fn is_tab_open(&self) -> bool
§is_tab_open
Returns whether the tab is open
Trait Implementations§
Source§impl Default for SelectStates
impl Default for SelectStates
Source§fn default() -> SelectStates
fn default() -> SelectStates
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SelectStates
impl RefUnwindSafe for SelectStates
impl Send for SelectStates
impl Sync for SelectStates
impl Unpin for SelectStates
impl UnwindSafe for SelectStates
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