pub enum Grain {
Char,
Word,
Run,
}Expand description
What a drag-select moves by. A press sets it from the click count the driver counted, the way every text UI does: one click drags by characters, two by words, three by whole runs.
The unit is not just a rounding of the live end — the anchor rounds too, and outwards. A double-click-drag that turns back on itself keeps the word it started in whole, which is what makes the gesture feel like it is selecting words rather than snapping to them.
Variants§
Char
Word
Run
One text node’s whole content — a label, a paragraph. cosmic-text
calls this a line; here a run is the thing a triple click takes.
In a cells grid it is one whole row, edge to edge, which is what
a triple click takes in every terminal.
Trait Implementations§
impl Copy for Grain
impl Eq for Grain
impl StructuralPartialEq for Grain
Auto Trait Implementations§
impl Freeze for Grain
impl RefUnwindSafe for Grain
impl Send for Grain
impl Sync for Grain
impl Unpin for Grain
impl UnsafeUnpin for Grain
impl UnwindSafe for Grain
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.