Struct rat_ftable::selection::RowSetSelection
source · pub struct RowSetSelection {
pub anchor: Option<usize>,
pub lead: Option<usize>,
pub selected: HashSet<usize>,
}Expand description
Allows selection an active range of rows.
The current range can be retired to a set of selected rows, and a new range be started. This allows multiple interval selection and deselection of certain rows.
This one only supports row-selection.
Fields§
§anchor: Option<usize>Start of the active selection.
lead: Option<usize>Current end of the active selection.
selected: HashSet<usize>Retired rows. This doesn’t contain the rows between anchor and lead.
You can call RowSetSelection::transfer_lead_anchor to add the anchor-lead range. This resets anchor and lead though. Or iterate the complete range and call RowSetSelection::is_selected_row.
Implementations§
source§impl RowSetSelection
impl RowSetSelection
sourcepub fn new() -> RowSetSelection
pub fn new() -> RowSetSelection
New selection.
sourcepub fn next(&mut self, n: usize, max: usize, extend: bool) -> bool
pub fn next(&mut self, n: usize, max: usize, extend: bool) -> bool
Select next. Maybe extend the range.
sourcepub fn set_lead(&mut self, lead: Option<usize>, extend: bool) -> bool
pub fn set_lead(&mut self, lead: Option<usize>, extend: bool) -> bool
Set a new lead. Maybe extend the range.
sourcepub fn set_lead_clamped(
&mut self,
lead: usize,
max: usize,
extend: bool
) -> bool
pub fn set_lead_clamped( &mut self, lead: usize, max: usize, extend: bool ) -> bool
Set a new lead, at the same time limit the lead to max.
sourcepub fn transfer_lead_anchor(&mut self)
pub fn transfer_lead_anchor(&mut self)
Transfers the range anchor to lead to the selection set and reset both.
Trait Implementations§
source§impl Clone for RowSetSelection
impl Clone for RowSetSelection
source§fn clone(&self) -> RowSetSelection
fn clone(&self) -> RowSetSelection
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for RowSetSelection
impl Debug for RowSetSelection
source§impl Default for RowSetSelection
impl Default for RowSetSelection
source§fn default() -> RowSetSelection
fn default() -> RowSetSelection
source§impl TableSelection for RowSetSelection
impl TableSelection for RowSetSelection
source§fn is_selected_row(&self, row: usize) -> bool
fn is_selected_row(&self, row: usize) -> bool
is_selected_cell.source§fn is_selected_column(&self, _column: usize) -> bool
fn is_selected_column(&self, _column: usize) -> bool
is_selected_cell.Auto Trait Implementations§
impl Freeze for RowSetSelection
impl RefUnwindSafe for RowSetSelection
impl Send for RowSetSelection
impl Sync for RowSetSelection
impl Unpin for RowSetSelection
impl UnwindSafe for RowSetSelection
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> 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