Struct exprtk_rs::SymbolTable[][src]

pub struct SymbolTable { /* fields omitted */ }

SymbolTable holds different variables. There are three types of variables: Numberic variables, strings and numeric vectors of fixed size. (see the documentation). Many but not all of the methods of the ExprTk symbol_table were implemented, and the API is sometimes different.

Methods

impl SymbolTable
[src]

Adds a new variable. Returns the variable ID that can later be used for set_value or None if a variable with the same name was already present.

Allows setting the values directly in an unsafe block, which may be useful, e.g. when benchmarking

Example:

use exprtk_rs::*;

let mut symbol_table = SymbolTable::new();
let id = symbol_table.add_variable("a", 2.).unwrap().unwrap();
let ptr = symbol_table.get_value_ptr(id).unwrap();
let expr = Expression::new("a - 1", symbol_table).unwrap();
assert_eq!(expr.value(), 1.);

unsafe {
    *ptr = 4.;
}
assert_eq!(expr.value(), 3.);

Adds a new string variable. Returns the variable ID that can later be used for set_string or None if a variable with the same name was already present.

Adds a new vector variable. Returns the variable ID that can later be used for vector or None if a variable with the same name was already present.

Returns the 'ID' of a variable or None if not found

Returns the 'ID' of a string or None if not found

Returns the 'ID' of a vector or None if not found

Important traits for Vec<u8>

Important traits for Vec<u8>

Important traits for Vec<u8>

impl SymbolTable
[src]

Add a function. Returns true if the function was added / false if the name was already present.

impl SymbolTable
[src]

Add a function. Returns true if the function was added / false if the name was already present.

impl SymbolTable
[src]

Add a function. Returns true if the function was added / false if the name was already present.

impl SymbolTable
[src]

Add a function. Returns true if the function was added / false if the name was already present.

Trait Implementations

impl Send for SymbolTable
[src]

impl Drop for SymbolTable
[src]

Executes the destructor for this type. Read more

impl Debug for SymbolTable
[src]

Formats the value using the given formatter. Read more

impl Clone for SymbolTable
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl !Sync for SymbolTable