pub trait ExprContext<T = DefaultTypeSet>{
// 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§
Sourcefn intern_string(&mut self, s: &str) -> StringIndex
fn intern_string(&mut self, s: &str) -> StringIndex
Implements string interning.
Sourcefn load_interned_string(&self, idx: StringIndex) -> &str
fn load_interned_string(&self, idx: StringIndex) -> &str
Loads an interned string.
Sourcefn try_load_variable(&self, variable: &str) -> Option<TypedValue<T>>
fn try_load_variable(&self, variable: &str) -> Option<TypedValue<T>>
Attempts to load a variable from the context.
Sourcefn address_of(&self, variable: &str) -> TypedValue<T>
fn address_of(&self, variable: &str) -> TypedValue<T>
Returns the address of a variable in the context.
Sourcefn call_function(
&mut self,
function_name: &str,
args: &[TypedValue<T>],
) -> Result<TypedValue<T>, FunctionCallError>
fn call_function( &mut self, function_name: &str, args: &[TypedValue<T>], ) -> Result<TypedValue<T>, FunctionCallError>
Calls a function in the context.