[][src]Struct evalexpr::Expr

pub struct Expr { /* fields omitted */ }

Expression builder

Methods

impl Expr[src]

pub fn new<T: Into<String>>(expr: T) -> Expr[src]

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]

Set function.

pub fn value<T, V>(self, name: T, value: V) -> Expr where
    T: Into<String>,
    V: Serialize
[src]

Set value.

pub fn compile(self) -> Result<Expr, Error>[src]

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]

Execute the expression.

Trait Implementations

impl Clone for Expr[src]

fn clone(&self) -> Expr[src]

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]

Performs copy-assignment from source. Read more

impl Debug for Expr[src]

Auto Trait Implementations

impl !Send for Expr

impl !Sync for Expr

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]