[−][src]Trait evalexpr::ContextMut
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<()>
&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<()>
&mut self,
identifier: S,
function: Function
) -> EvalexprResult<()>
Links the given function to the given identifier.
Implementors
impl ContextMut for EmptyContext
[src]
fn set_value<S: Into<String>, V: Into<Value>>(
&mut self,
_identifier: S,
_value: V
) -> EvalexprResult<()>
[src]
&mut self,
_identifier: S,
_value: V
) -> EvalexprResult<()>
fn set_function<S: Into<String>>(
&mut self,
_identifier: S,
_function: Function
) -> EvalexprResult<()>
[src]
&mut self,
_identifier: S,
_function: Function
) -> EvalexprResult<()>
impl ContextMut for HashMapContext
[src]
fn set_value<S: Into<String>, V: Into<Value>>(
&mut self,
identifier: S,
value: V
) -> EvalexprResult<()>
[src]
&mut self,
identifier: S,
value: V
) -> EvalexprResult<()>
fn set_function<S: Into<String>>(
&mut self,
identifier: S,
function: Function
) -> EvalexprResult<()>
[src]
&mut self,
identifier: S,
function: Function
) -> EvalexprResult<()>