Struct eval::Expr [−][src]
pub struct Expr { /* fields omitted */ }
Expression builder
Methods
impl Expr
[src]
impl Expr
pub fn new<T: Into<String>>(expr: T) -> Expr
[src]
pub fn new<T: Into<String>>(expr: T) -> Expr
Create an expression.
pub fn function<T, F>(self, name: T, function: F) -> Expr where
T: Into<String>,
F: 'static + Fn(Vec<Value>) -> Result<Value, Error> + Sync + Send,
[src]
pub 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.
pub fn value<T, V>(self, name: T, value: V) -> Expr where
T: Into<String>,
V: Serialize,
[src]
pub fn value<T, V>(self, name: T, value: V) -> Expr where
T: Into<String>,
V: Serialize,
Set value.
pub fn compile(self) -> Result<Expr, Error>
[src]
pub 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.
pub fn exec(&self) -> Result<Value, Error>
[src]
pub fn exec(&self) -> Result<Value, Error>
Execute the expression.
Trait Implementations
impl Clone for Expr
[src]
impl Clone for Expr
fn clone(&self) -> 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[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl Debug for Expr
[src]
impl Debug for Expr