pub struct Selection { /* private fields */ }Expand description
A selection of row indices. See the module docs.
Implementations§
Source§impl Selection
impl Selection
pub fn new() -> Self
pub fn is_empty(&self) -> bool
Sourcepub fn cursor(&self) -> Option<usize>
pub fn cursor(&self) -> Option<usize>
The row keyboard navigation moves from (the last row clicked or moved to).
Sourcepub fn ranges(&self) -> impl Iterator<Item = Range<usize>> + '_
pub fn ranges(&self) -> impl Iterator<Item = Range<usize>> + '_
The selected rows as sorted ranges.
Sourcepub fn select_only(&mut self, row: usize)
pub fn select_only(&mut self, row: usize)
Select only row (a plain click or arrow key): it becomes the anchor and the cursor.
Sourcepub fn toggle(&mut self, row: usize)
pub fn toggle(&mut self, row: usize)
Toggle row (⌘/Ctrl-click): it becomes the anchor and the cursor.
Sourcepub fn extend_to(&mut self, row: usize)
pub fn extend_to(&mut self, row: usize)
Select the rows from the anchor to row (Shift-click, Shift+arrows), replacing the
previous selection; the anchor stays, the cursor moves to row.
Sourcepub fn select_all(&mut self, rows: usize)
pub fn select_all(&mut self, rows: usize)
Select rows 0..rows (⌘A); the cursor and anchor stay.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Selection
impl<'de> Deserialize<'de> for Selection
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Selection
impl StructuralPartialEq for Selection
Auto Trait Implementations§
impl Forget for Selection
impl Freeze for Selection
impl Move for Selection
impl RefUnwindSafe for Selection
impl Send for Selection
impl Sync for Selection
impl Unpin for Selection
impl UnsafeUnpin for Selection
impl UnwindSafe for Selection
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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