[][src]Trait evalexpr::ContextMut

pub trait ContextMut: Context {
    fn set_value<S: Into<String>, V: Into<Value>>(
        &mut self,
        identifier: S,
        value: V
    ) -> EvalexprResult<()>;
fn set_function<S: Into<String>>(
        &mut self,
        identifier: S,
        function: Function
    ) -> EvalexprResult<()>; }

A mutable context for an expression tree.

In addition to all functionality of a Context, a mutable context also allows the manipulation of values and functions. This crate implements two basic variants, the EmptyContext, that returns an error for each manipulation, and the HashMapContext, that stores its mappings in hash maps. The HashMapContext is type-safe and returns an error if the user tries to assign a value of a different type than before to an identifier.

Required methods

fn set_value<S: Into<String>, V: Into<Value>>(
    &mut self,
    identifier: S,
    value: V
) -> EvalexprResult<()>

Links the given value to the given identifier.

fn set_function<S: Into<String>>(
    &mut self,
    identifier: S,
    function: Function
) -> EvalexprResult<()>

Links the given function to the given identifier.

Loading content...

Implementors

impl ContextMut for EmptyContext[src]

impl ContextMut for HashMapContext[src]

Loading content...