Skip to main content

Evaluator

Struct Evaluator 

Source
pub struct Evaluator<'h> {
    pub host: &'h mut dyn Host,
    pub sheet: usize,
    pub at: CellRef,
    /* private fields */
}

Fields§

§host: &'h mut dyn Host§sheet: usize§at: CellRef

Implementations§

Source§

impl<'h> Evaluator<'h>

Source

pub fn apply_lambda(&mut self, l: &Lambda, args: &[Expr]) -> Ev

Source§

impl<'h> Evaluator<'h>

Source

pub fn new(host: &'h mut dyn Host, sheet: usize, at: CellRef) -> Self

Source

pub fn value(&mut self, e: &Expr) -> Value

Evaluates to a value (references are dereferenced; multi-cell → array).

Source

pub fn reference_areas(&self, r: &Reference) -> Result<Vec<Area>, CellError>

Source

pub fn deref(&mut self, ev: Ev) -> Value

Dereferences: one cell → its value; a block → an array; several areas → #VALUE!.

A block keeps its full shape (blanks included) when it holds at most FULL_SIZE_CELLS cells, or when it holds at most FULL_SIZE_BOUNDED_CELLS cells (one full column’s worth) and does not run to the sheet’s last row or column. Every other block (larger, or a bigger one that runs to the sheet’s edge, such as A:A or 1:1) is trimmed to the sheet’s used range before its values are read. An array over MAX_CELLS is #NUM!.

Source

pub fn area_value(&mut self, a: &Area) -> Value

Source

pub fn trim(&mut self, a: &Area) -> RangeRef

Trims the bottom/right of an area to the sheet’s used range (keeps the top-left so positions stay right).

Source

pub fn eval(&mut self, e: &Expr) -> Ev

Auto Trait Implementations§

§

impl<'h> !RefUnwindSafe for Evaluator<'h>

§

impl<'h> !Send for Evaluator<'h>

§

impl<'h> !Sync for Evaluator<'h>

§

impl<'h> !UnwindSafe for Evaluator<'h>

§

impl<'h> Freeze for Evaluator<'h>

§

impl<'h> Unpin for Evaluator<'h>

§

impl<'h> UnsafeUnpin for Evaluator<'h>

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> 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> Same for T

Source§

type Output = T

Should always be Self
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.