pub struct ListState { /* private fields */ }Expand description
Unified list state machine for single and multi-select
Implementations§
Source§impl ListState
impl ListState
pub fn new(len: usize, multi_select: bool, initial_diff: bool) -> Self
pub fn cursor(&self) -> usize
pub fn show_diff(&self) -> bool
pub fn is_selected(&self, index: usize) -> bool
pub fn selected_count(&self) -> usize
Sourcepub fn selected_indices(&self) -> Vec<usize>
pub fn selected_indices(&self) -> Vec<usize>
Get sorted list of selected indices for deterministic iteration
pub fn multi_select(&self) -> bool
Sourcepub fn handle(&mut self, action: ListAction) -> Option<ListResult>
pub fn handle(&mut self, action: ListAction) -> Option<ListResult>
Handle a list action, returns Some if the interaction is complete
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ListState
impl RefUnwindSafe for ListState
impl Send for ListState
impl Sync for ListState
impl Unpin for ListState
impl UnwindSafe for ListState
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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