Struct aftermath::Context

source ·
pub struct Context {
    pub zero_precision: f64,
    /* private fields */
}

Fields§

§zero_precision: f64

Implementations§

Creates a new empty context

Get an iterator over the reserved names for this context You should only call this function once and cache its result But you can call it multiples times

Errors

Return an error if the requested binding isn’t found in this context

Errors

Return an error if the requested binding isn’t found in this context

Errors

Return an error if the requested function isn’t found in this context

Insert the given function into the context, overwriting if the function already existed

Insert the given binding into the context, overwriting if the binding already existed

Evaluate an AST in the current Context

Errors

This will return an error if any of the operation return an error

Evaluate an RPN sequence in the current context

Errors

This will return an error on three separate instances: - A User-Function has returned an error - A bindings is missing in the current context - A User-Function is missing in the current context

Check that the given f64 can be considered equal to zero It uses the field zero_precision to get a range of values (-zero_precision, +zero_precision) this considered equal to zero

Check that the given Complex number is close enough to zero to be considered equal to zero

Check if a f64 is close enough to another one to be considered equal

Check if a complex number is near enough to another one to be considered equal

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
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 resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
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.