Skip to main content

FormulaPart

Enum FormulaPart 

Source
pub enum FormulaPart {
    Text(String),
    SheetReference {
        sheet_id: u64,
        row: usize,
        col: usize,
        row_ref_type: RefType,
        col_ref_type: RefType,
    },
    ColumnReference {
        sheet_id: u64,
        col_id: u64,
    },
    StructuredReference {
        sheet_id: u64,
        col_id: Option<u64>,
        is_this_row: bool,
        section: SheetSection,
    },
    RangeReference {
        sheet_id: u64,
        start_row: usize,
        start_col: usize,
        end_row: usize,
        end_col: usize,
        start_row_ref_type: RefType,
        start_col_ref_type: RefType,
        end_row_ref_type: RefType,
        end_col_ref_type: RefType,
    },
}
Expand description

One piece of a compiled formula: either literal text or a reference held by id.

Variants§

§

Text(String)

A literal stretch of the formula – operators, function names, constants – copied through unchanged.

§

SheetReference

A single cell, as in Sheet2!$A1.

Fields

§sheet_id: u64

Sheet the cell is on.

§row: usize

Row, 0-based.

§col: usize

Column, 0-based.

§row_ref_type: RefType

Whether the row was written with a $.

§col_ref_type: RefType

Whether the column was written with a $.

§

ColumnReference

A whole column, held by column id so a column rename survives.

Fields

§sheet_id: u64

Sheet the column is on.

§col_id: u64

The column’s identifier, not its position.

§

StructuredReference

An Excel Table structured reference, as in Sales[Amount] or [@Amount].

Fields

§sheet_id: u64

Sheet the reference resolves against.

§col_id: Option<u64>

The referenced column, or None for a whole-table reference.

§is_this_row: bool

true for the [@Amount] form, which means the current row.

§section: SheetSection

Which part of the table is selected.

§

RangeReference

A rectangular range, as in Sheet2!A1:$B$10.

Fields

§sheet_id: u64

Sheet the range is on.

§start_row: usize

First row, 0-based.

§start_col: usize

First column, 0-based.

§end_row: usize

Last row, 0-based and inclusive.

§end_col: usize

Last column, 0-based and inclusive.

§start_row_ref_type: RefType

Whether the start row was written with a $.

§start_col_ref_type: RefType

Whether the start column was written with a $.

§end_row_ref_type: RefType

Whether the end row was written with a $.

§end_col_ref_type: RefType

Whether the end column was written with a $.

Trait Implementations§

Source§

impl Clone for FormulaPart

Source§

fn clone(&self) -> FormulaPart

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 FormulaPart

Source§

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

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

impl<'de> Deserialize<'de> for FormulaPart

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for FormulaPart

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl Serialize for FormulaPart

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for FormulaPart

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V