pub struct InputListState { /* private fields */ }Expand description
Represents the state of an input list.
Implementations§
Source§impl InputListState
impl InputListState
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Creates a new InputListState.
Sourcepub const fn create(length: usize) -> Self
pub const fn create(length: usize) -> Self
Creates a new InputListState with the provided list length.
Sourcepub fn scroll_up_by(&mut self, val: usize) -> usize
pub fn scroll_up_by(&mut self, val: usize) -> usize
Scrolls down the first by the provided amount.
If the amount scrolls out-of-bounds, the first item is selected.
Sourcepub fn scroll_down_by(&mut self, val: usize) -> usize
pub fn scroll_down_by(&mut self, val: usize) -> usize
Scrolls down the list by the provided amount.
If the amount scrolls out-of-bounds, the last item is selected.
Sourcepub fn select(&mut self, val: usize) -> usize
pub fn select(&mut self, val: usize) -> usize
Selects the provided index.
If the index is out-of-bounds:
- below offset: offet is selected
- above last item: the last item is selected
Sourcepub fn select_first(&mut self) -> usize
pub fn select_first(&mut self) -> usize
Selects the first list entry.
Sourcepub fn select_last(&mut self) -> usize
pub fn select_last(&mut self) -> usize
Selects the last list entry.
Sourcepub fn select_previous(&mut self) -> usize
pub fn select_previous(&mut self) -> usize
Selects the previous list entry.
Sourcepub fn select_next(&mut self) -> usize
pub fn select_next(&mut self) -> usize
Selects the next list entry.
Source§impl InputListState
impl InputListState
Sourcepub const fn length(&self) -> usize
pub const fn length(&self) -> usize
Gets the InputListState length.
Sourcepub fn set_length(&mut self, val: usize)
pub fn set_length(&mut self, val: usize)
Sets the InputListState length.
Sourcepub fn with_length(self, val: usize) -> Self
pub fn with_length(self, val: usize) -> Self
Builder function that sets the InputListState length.
Sourcepub const fn offset(&self) -> usize
pub const fn offset(&self) -> usize
Gets the InputListState offset.
Sourcepub fn set_offset(&mut self, val: usize)
pub fn set_offset(&mut self, val: usize)
Sets the InputListState offset.
Sourcepub fn with_offset(self, val: usize) -> Self
pub fn with_offset(self, val: usize) -> Self
Builder function that sets the InputListState offset.
Source§impl InputListState
impl InputListState
Sourcepub const fn selected(&self) -> Option<usize>
pub const fn selected(&self) -> Option<usize>
Gets the InputListState selected.
Sourcepub fn set_selected(&mut self, val: usize)
pub fn set_selected(&mut self, val: usize)
Sets the InputListState selected.
Sourcepub fn unset_selected(&mut self) -> Option<usize>
pub fn unset_selected(&mut self) -> Option<usize>
Unsets the InputListState selected.
Sourcepub fn with_selected(self, val: usize) -> Self
pub fn with_selected(self, val: usize) -> Self
Builder function that sets the InputListState selected.
Trait Implementations§
Source§impl Clone for InputListState
impl Clone for InputListState
Source§fn clone(&self) -> InputListState
fn clone(&self) -> InputListState
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for InputListState
impl Debug for InputListState
Source§impl Default for InputListState
impl Default for InputListState
Source§impl PartialEq for InputListState
impl PartialEq for InputListState
impl Copy for InputListState
impl Eq for InputListState
impl StructuralPartialEq for InputListState
Auto Trait Implementations§
impl Freeze for InputListState
impl RefUnwindSafe for InputListState
impl Send for InputListState
impl Sync for InputListState
impl Unpin for InputListState
impl UnwindSafe for InputListState
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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>
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>
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