Struct eval::Expr
[−]
[src]
pub struct Expr { /* fields omitted */ }Expression builder
Methods
impl Expr[src]
fn new<T: Into<String>>(expr: T) -> Expr
Create an expression.
fn function<T, F>(self, name: T, function: F) -> Expr where T: Into<String>, F: 'static + Fn(Vec<Value>) -> Result<Value, Error> + Sync + Send
Set function.
fn value<T, V>(self, name: T, value: V) -> Expr where T: Into<String>, V: Serialize
Set value.
fn compile(self) -> Result<Expr, Error>
Compile an expression. An expression can be compiled only once and then invoked multiple times with different context and function. You can also execute a expression without compile.
fn exec(&self) -> Result<Value, Error>
Execute the expression.
Trait Implementations
impl Clone for Expr[src]
fn clone(&self) -> Expr
Returns a copy of the value. Notice that functions can not be cloned. The cloned expr's functions will be empty.
fn clone_from(&mut self, source: &Self)1.0.0
Performs copy-assignment from source. Read more