pub struct SelectionState { /* private fields */ }Expand description
State for single-item selection in a list.
Implementations§
Source§impl SelectionState
impl SelectionState
Sourcepub fn auto_select_first_if_empty(&mut self, has_items: bool)
pub fn auto_select_first_if_empty(&mut self, has_items: bool)
Auto-select the first item if nothing is selected and items exist.
Sourcepub fn jump_to_first(&mut self)
pub fn jump_to_first(&mut self)
Jump to the first item.
Sourcepub fn jump_to_last(&mut self, len: usize)
pub fn jump_to_last(&mut self, len: usize)
Jump to the last item.
Sourcepub fn is_selected(&self, index: usize) -> bool
pub fn is_selected(&self, index: usize) -> bool
Check if an index is selected.
Sourcepub fn has_selection(&self) -> bool
pub fn has_selection(&self) -> bool
Check if anything is selected.
Trait Implementations§
Source§impl Clone for SelectionState
impl Clone for SelectionState
Source§fn clone(&self) -> SelectionState
fn clone(&self) -> SelectionState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SelectionState
impl Debug for SelectionState
Source§impl Default for SelectionState
impl Default for SelectionState
Source§fn default() -> SelectionState
fn default() -> SelectionState
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SelectionState
impl RefUnwindSafe for SelectionState
impl Send for SelectionState
impl Sync for SelectionState
impl Unpin for SelectionState
impl UnwindSafe for SelectionState
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