EvaluationContext

Struct EvaluationContext 

Source
pub struct EvaluationContext<'c, E: Evaluate> { /* private fields */ }
Expand description

Context that is used in the evaluation process of a block.

Implementations§

Source§

impl<'c, E: Evaluate> EvaluationContext<'c, E>

Source

pub fn new( global_variables: &'c Variables, local_variables: Vec<Variables>, builders: &'c HashMap<String, E>, functions: &'c HashMap<String, Box<dyn Fn(&[Value]) -> Value + 'static>>, max_depth: usize, warnings: EvaluationContextWarnings, context_location: ContextLocation, ) -> Self

Source

pub fn spawn_new( &self, local_variables: Vec<Variables>, context_location: ContextLocation, ) -> Result<Self, ()>

Source

pub fn get_evaluator(&self, name: &str) -> Option<&'c E>

Source

pub fn get_function(&self, name: &str) -> Option<&'c ValueFunction>

Source

pub fn get_variable_value(&self, name: &str) -> Option<Value>

Source

pub fn push_variables(&mut self, variables: Variables)

Source

pub fn pop_variables(&mut self)

Source

pub fn assign_local_variable(&mut self, name: &str, value: Value)

Auto Trait Implementations§

§

impl<'c, E> Freeze for EvaluationContext<'c, E>

§

impl<'c, E> !RefUnwindSafe for EvaluationContext<'c, E>

§

impl<'c, E> !Send for EvaluationContext<'c, E>

§

impl<'c, E> !Sync for EvaluationContext<'c, E>

§

impl<'c, E> Unpin for EvaluationContext<'c, E>

§

impl<'c, E> !UnwindSafe for EvaluationContext<'c, E>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.