pub struct Selection {
pub active: CellRef,
pub anchor: CellRef,
pub ranges: Vec<RangeRef>,
}Fields§
§active: CellRefThe active (white) cell.
anchor: CellRefWhere a Shift-extension is anchored.
ranges: Vec<RangeRef>Selected areas; the last one contains the active cell. Never empty.
Implementations§
Source§impl Selection
impl Selection
pub fn at(c: CellRef) -> Selection
pub fn range(r: RangeRef) -> Selection
pub fn contains(&self, c: CellRef) -> bool
pub fn is_single_cell(&self) -> bool
Sourcepub fn moving_end(&self) -> CellRef
pub fn moving_end(&self) -> CellRef
The corner of the current area opposite the anchor: the end that Shift+arrows move.
Sourcepub fn extend_to(&mut self, to: CellRef)
pub fn extend_to(&mut self, to: CellRef)
Extends the current area from the anchor to to (Shift+click / Shift+arrows).
Sourcepub fn expand_merges(&mut self, sheet: &Sheet)
pub fn expand_merges(&mut self, sheet: &Sheet)
Expands areas so merged cells are included whole. Whole columns and whole rows stay as they are: clicking column B’s header selects just B even when B1:C1 is merged, as in Excel.
Source§impl Selection
impl Selection
Sourcepub fn next_corner(&mut self)
pub fn next_corner(&mut self)
Ctrl+. (Next Corner of Selection): the active cell moves clockwise to the next corner of the current area (top-left, top-right, bottom-right, bottom-left) and becomes the anchor, so Shift+arrows then move the opposite corner. The area stays selected. From a cell that isn’t a corner the next corner is the top-left one; a single cell stays where it is.
Sourcepub fn next_corner_by(&mut self, stop: impl Fn(CellRef) -> Option<CellRef>)
pub fn next_corner_by(&mut self, stop: impl Fn(CellRef) -> Option<CellRef>)
Selection::next_corner where stop says where each corner takes the active cell: the
top-left cell of a merged cell the corner is in, or None for a corner that can’t be
selected (it is skipped). Corners that end up on the active cell are one stop with it.
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>,
impl Eq for Selection
impl StructuralPartialEq for Selection
Auto Trait Implementations§
impl Freeze 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
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>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.