pub struct Context<N> {
    pub history: Vec<N>,
}
Expand description

Calculation context.

Stores a history of calculated values, so that the history lookups (@) work properly. Also reifies the numeric type backing the calculations.

Fields

history: Vec<N>

Implementations

Evaluate an expression in this context.

This both returns the calculated value and stores a copy in the context’s history.

Evaluate an annotated expression in this context.

Annotations can include output formatting directives. Therefore, the return value is a formatted String.

This also stores a copy in the context’s history.

Trait Implementations

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.