[][src]Trait evalexpr::Context

pub trait Context {
    fn get_value(&self, identifier: &str) -> Option<&Value>;
fn get_function(&self, identifier: &str) -> Option<&Function>; }

A context for an expression tree.

A context defines methods to retrieve values and functions for literals in an expression tree. This crate implements two basic variants, the EmptyContext, that returns None for each identifier and cannot be manipulated, and the HashMapContext, that stores its mappings in hash maps.

Required methods

fn get_value(&self, identifier: &str) -> Option<&Value>

Returns the value that is linked to the given identifier.

fn get_function(&self, identifier: &str) -> Option<&Function>

Returns the function that is linked to the given identifier.

Loading content...

Implementors

impl Context for EmptyContext[src]

impl Context for HashMapContext[src]

Loading content...