Struct rat_widget::table::selection::RowSelection
source · 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 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 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 copy 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.source§fn scroll_selected(&self) -> bool
fn scroll_selected(&self) -> bool
Should scroll be in terms of the selection or in terms of the offset.
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)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