pub struct TableStates {
pub list_index: usize,
pub list_len: usize,
}Expand description
The state that has to be kept for the Table component.
Fields§
§list_index: usizeIndex of selected item in textarea
list_len: usizeLines in text area
Implementations§
Source§impl TableStates
impl TableStates
Sourcepub fn set_list_len(&mut self, len: usize)
pub fn set_list_len(&mut self, len: usize)
Set list length.
Sourcepub fn incr_list_index(&mut self, rewind: bool)
pub fn incr_list_index(&mut self, rewind: bool)
Incremenet list index.
Sourcepub fn decr_list_index(&mut self, rewind: bool)
pub fn decr_list_index(&mut self, rewind: bool)
Decrement list index.
Sourcepub fn fix_list_index(&mut self)
pub fn fix_list_index(&mut self)
Keep index if possible, otherwise set to lenght - 1.
Sourcepub fn list_index_at_first(&mut self)
pub fn list_index_at_first(&mut self)
Set list index to the first item in the list.
Sourcepub fn list_index_at_last(&mut self)
pub fn list_index_at_last(&mut self)
Set list index at the last item of the list.
Sourcepub fn calc_max_step_ahead(&self, max: usize) -> usize
pub fn calc_max_step_ahead(&self, max: usize) -> usize
Calculate the max step ahead to scroll list.
Sourcepub fn calc_max_step_behind(&self, max: usize) -> usize
pub fn calc_max_step_behind(&self, max: usize) -> usize
Calculate the max step ahead to scroll list.
Trait Implementations§
Source§impl Default for TableStates
impl Default for TableStates
Source§fn default() -> TableStates
fn default() -> TableStates
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TableStates
impl RefUnwindSafe for TableStates
impl Send for TableStates
impl Sync for TableStates
impl Unpin for TableStates
impl UnsafeUnpin for TableStates
impl UnwindSafe for TableStates
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