Trait ExprContext

Source
pub trait ExprContext<T = DefaultTypeSet>
where T: TypeSet, T::Integer: ValueType, T::Float: ValueType,
{ // Required methods fn intern_string(&mut self, s: &str) -> StringIndex; fn load_interned_string(&self, idx: StringIndex) -> &str; fn try_load_variable(&self, variable: &str) -> Option<TypedValue<T>>; fn address_of(&self, variable: &str) -> TypedValue<T>; fn call_function( &mut self, function_name: &str, args: &[TypedValue<T>], ) -> Result<TypedValue<T>, FunctionCallError>; }
Expand description

An expression context that provides the necessary environment for evaluating expressions.

Required Methods§

Source

fn intern_string(&mut self, s: &str) -> StringIndex

Implements string interning.

Source

fn load_interned_string(&self, idx: StringIndex) -> &str

Loads an interned string.

Source

fn try_load_variable(&self, variable: &str) -> Option<TypedValue<T>>

Attempts to load a variable from the context.

Source

fn address_of(&self, variable: &str) -> TypedValue<T>

Returns the address of a variable in the context.

Source

fn call_function( &mut self, function_name: &str, args: &[TypedValue<T>], ) -> Result<TypedValue<T>, FunctionCallError>

Calls a function in the context.

Implementors§

Source§

impl<T> ExprContext<T> for Context<'_, T>
where T: TypeSet, T::Integer: Load<T> + Store<T> + Integer, T::Float: Load<T> + Store<T>, T::SignedInteger: Load<T> + Store<T>,