pub struct RowSelection {
pub lead_row: Option<usize>,
pub scroll_selected: bool,
}Expand description
Allows selecting a single row of the table.
This is the right one if you want a list-style selection for your table.
This one only supports row-selection.
Fields§
§lead_row: Option<usize>Selected row.
scroll_selected: boolScrolls the selection instead of the offset.
Implementations§
Source§impl RowSelection
impl RowSelection
Sourcepub fn new() -> RowSelection
pub fn new() -> RowSelection
New selection.
Sourcepub fn scroll_selected(&self) -> bool
pub fn scroll_selected(&self) -> bool
Scroll selection instead of offset.
Sourcepub fn set_scroll_selected(&mut self, scroll: bool)
pub fn set_scroll_selected(&mut self, scroll: bool)
Scroll selection instead of offset.
Sourcepub fn has_selection(&self) -> bool
pub fn has_selection(&self) -> bool
Has some selection.
Sourcepub fn select(&mut self, select: Option<usize>) -> bool
pub fn select(&mut self, select: Option<usize>) -> bool
Select a row. This function doesn’t care if the given row actually exists in the table.
Sourcepub fn items_added(&mut self, pos: usize, n: usize)
pub fn items_added(&mut self, pos: usize, n: usize)
Update the state to match adding items.
Sourcepub fn items_removed(&mut self, pos: usize, n: usize, maximum: usize)
pub fn items_removed(&mut self, pos: usize, n: usize, maximum: usize)
Update the state to match removing items.
This will leave the selection at 0 after the last item has been removed.
Sourcepub fn move_to(&mut self, select: usize, maximum: usize) -> bool
pub fn move_to(&mut self, select: usize, maximum: usize) -> bool
Select the given row, limit between 0 and maximum.
Trait Implementations§
Source§impl Clone for RowSelection
impl Clone for RowSelection
Source§fn clone(&self) -> RowSelection
fn clone(&self) -> RowSelection
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 RowSelection
impl Debug for RowSelection
Source§impl Default for RowSelection
impl Default for RowSelection
Source§fn default() -> RowSelection
fn default() -> RowSelection
Returns the “default value” for a type. Read more
Source§impl TableSelection for RowSelection
impl TableSelection for RowSelection
Source§fn is_selected_row(&self, row: usize) -> bool
fn is_selected_row(&self, row: usize) -> bool
Row is selected. This can be separate from
is_selected_cell.Source§fn is_selected_column(&self, _column: usize) -> bool
fn is_selected_column(&self, _column: usize) -> bool
Column is selected. This can be separate from
is_selected_cell.Auto Trait Implementations§
impl Freeze for RowSelection
impl RefUnwindSafe for RowSelection
impl Send for RowSelection
impl Sync for RowSelection
impl Unpin for RowSelection
impl UnwindSafe for RowSelection
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> 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