pub struct ListState {
pub selected: usize,
pub total: usize,
pub scroll_offset: usize,
}Expand description
Base state for simple list navigation.
Can be embedded in more complex state structs to provide common navigation functionality.
Fields§
§selected: usize§total: usize§scroll_offset: usizeImplementations§
Trait Implementations§
Source§fn set_selected(&mut self, idx: usize)
fn set_selected(&mut self, idx: usize)
Set the selection index.
Source§fn select_next(&mut self)
fn select_next(&mut self)
Move selection to the next item.
Source§fn select_prev(&mut self)
fn select_prev(&mut self)
Move selection to the previous item.
Source§fn clamp_selection(&mut self)
fn clamp_selection(&mut self)
Ensure selection is within valid bounds.
Auto Trait Implementations§
impl Freeze for ListState
impl RefUnwindSafe for ListState
impl Send for ListState
impl Sync for ListState
impl Unpin for ListState
impl UnsafeUnpin 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