pub struct SpillRect {
pub anchor: Address,
pub rows: u32,
pub cols: u32,
}Expand description
An in-bounds spill rectangle: the geometry of one anchor’s reconstructed
array. Cheap to copy; membership and indexing are O(1).
Fields§
§anchor: AddressThe anchor (top-left) cell — the authored formula cell.
rows: u32Row count of the array (≥ 1).
cols: u32Column count of the array (≥ 1).
Implementations§
Source§impl SpillRect
impl SpillRect
Sourcepub fn contains(&self, addr: Address) -> bool
pub fn contains(&self, addr: Address) -> bool
Whether addr lies inside this rectangle (anchor included).
Sourcepub fn offset_of(&self, addr: Address) -> Option<(usize, usize)>
pub fn offset_of(&self, addr: Address) -> Option<(usize, usize)>
The (i, j) offset of addr within this rectangle (anchor = (0, 0)),
or None if addr is outside it. The element of the anchor’s array at
[i][j] is the value spilled to addr.
Sourcepub fn spilled_cells(&self) -> impl Iterator<Item = Address> + '_
pub fn spilled_cells(&self) -> impl Iterator<Item = Address> + '_
Iterates the non-anchor cells of the rectangle (the spilled cells), in reading order. The addresses are all in-bounds by construction.
Trait Implementations§
impl Copy for SpillRect
impl Eq for SpillRect
impl StructuralPartialEq for SpillRect
Auto Trait Implementations§
impl Freeze for SpillRect
impl RefUnwindSafe for SpillRect
impl Send for SpillRect
impl Sync for SpillRect
impl Unpin for SpillRect
impl UnsafeUnpin for SpillRect
impl UnwindSafe for SpillRect
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