Struct exprtk_rs::Expression[][src]

pub struct Expression { /* fields omitted */ }

Methods

impl Expression
[src]

Compiles a new Expression. Missing variables will lead to a exprtk::ParseError.

Example:

The above example melts down to this:

use exprtk_rs::*;

let mut symbol_table = SymbolTable::new();
symbol_table.add_variable("a", 2.).unwrap();
let expr = Expression::new("a + 1", symbol_table).unwrap();
assert_eq!(expr.value(), 3.);

Compiles a new Expression. Missing variables are automatically added to the SymbolTable and initialized with 0.. Their names and IDs are returned as tuple together with the Expression instance.

Calculates the value of the expression. Returns NaN if the expression was not yet compiled.

Trait Implementations

impl Send for Expression
[src]

impl Drop for Expression
[src]

Executes the destructor for this type. Read more

impl Debug for Expression
[src]

Formats the value using the given formatter. Read more

impl Clone for Expression
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl !Sync for Expression