Skip to main content

RefExpr

Struct RefExpr 

Source
pub struct RefExpr {
    pub sheet: Option<String>,
    pub last_sheet: Option<String>,
    pub top: u32,
    pub left: u32,
    pub bottom: u32,
    pub right: u32,
    pub written: String,
    pub shape: Shape,
    pub corners: Corners,
    pub found: Option<(u8, u8)>,
}
Expand description

One reference as the parser hands it to the evaluator: a rectangle on one sheet, or the same rectangle on every sheet of a span.

Fields§

§sheet: Option<String>

The sheet named in front of !, or None for the formula’s own.

§last_sheet: Option<String>

The last sheet of a 3D span, Jan:Dec!A1.

§top: u32§left: u32§bottom: u32§right: u32§written: String

The reference as written, for a label.

§shape: Shape

The reference’s part as the scanner read it (a cell, a range, a whole column or row) and its corners as written with their $ marks, which a move at an offset reads (KERNEL.22): the rectangle above is these corners sorted.

§corners: Corners§found: Option<(u8, u8)>

The sheets named in front of !, the first and the last, found once against the grid an engine’s machine placed the formula in (KERNEL.20), whose sheets are fixed for its life. None for a reference to the formula’s own sheet, for a sheet the grid does not hold, for one past the 256th, and for any parse not placed, each of which finds its sheets by name at every evaluation, as before. A byte each, so that the field fits the padding the struct already had: a parse’s size is what VLA.1’s limits are pinned on, a stack of 1 MiB, and the reference is the largest kind of expression (measured: two words would have made every expression 24 bytes larger and the deepest formula’s load 192 KiB deeper).

Implementations§

Source§

impl RefExpr

Source

pub fn is_cell(&self) -> bool

Whether the reference names one cell.

Source

pub fn moved(&self, d_row: i64, d_col: i64) -> Option<(u32, u32, u32, u32)>

The rectangle this reference names in a cell d_row rows down and d_col columns right of the cell whose formula it was read from: each relative number moved and each $ one kept, corner by corner as written, then sorted, which is what parsing the text that refers::shift_a1_references moves gives (KERNEL.22, a shape evaluated at an offset); None when a corner leaves the sheet, where the mover writes #REF!. At no offset it is the rectangle as read.

Trait Implementations§

Source§

impl Clone for RefExpr

Source§

fn clone(&self) -> RefExpr

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RefExpr

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Eq for RefExpr

Source§

impl PartialEq for RefExpr

Source§

fn eq(&self, other: &RefExpr) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for RefExpr

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.