[−][src]Struct evalexpr::Expr
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]
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]
T: Into<String>,
V: Serialize,
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
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,