Struct rhai::EvalContext[][src]

pub struct EvalContext<'a, 'x, 'px, 'm, 's, 't, 'pt> { /* fields omitted */ }
Expand description

Context of a script evaluation process.

Implementations

impl<'x, 'px> EvalContext<'_, 'x, 'px, '_, '_, '_, '_>[src]

pub fn engine(&self) -> &Engine[src]

The current Engine.

pub fn source(&self) -> Option<&str>[src]

The current source.

pub fn scope(&self) -> &Scope<'_>[src]

The current Scope.

pub fn scope_mut(&mut self) -> &mut &'x mut Scope<'px>[src]

Mutable reference to the current Scope.

pub fn iter_imports(&self) -> impl Iterator<Item = (&str, &Module)>[src]

Get an iterator over the current set of modules imported via import statements.

pub fn imports(&self) -> &Imports[src]

(INTERNALS) The current set of modules imported via import statements. Exported under the internals feature only.

pub fn iter_namespaces(&self) -> impl Iterator<Item = &Module>[src]

Get an iterator over the namespaces containing definition of all script-defined functions.

pub fn namespaces(&self) -> &[&Module][src]

(INTERNALS) The current set of namespaces containing definitions of all script-defined functions. Exported under the internals feature only.

pub fn this_ptr(&self) -> Option<&Dynamic>[src]

The current bound this pointer, if any.

pub fn call_level(&self) -> usize[src]

The current nesting level of function calls.

impl EvalContext<'_, '_, '_, '_, '_, '_, '_>[src]

pub fn eval_expression_tree(
    &mut self,
    expr: &Expression<'_>
) -> Result<Dynamic, Box<EvalAltResult>>
[src]

Evaluate an expression tree.

WARNING - Low Level API

This function is very low level. It evaluates an expression from an AST.

Trait Implementations

impl<'a, 'x, 'px, 'm, 's, 't, 'pt> Debug for EvalContext<'a, 'x, 'px, 'm, 's, 't, 'pt>[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl<'a, 'x, 'px, 'm, 's, 't, 'pt> !RefUnwindSafe for EvalContext<'a, 'x, 'px, 'm, 's, 't, 'pt>

impl<'a, 'x, 'px, 'm, 's, 't, 'pt> !Send for EvalContext<'a, 'x, 'px, 'm, 's, 't, 'pt>

impl<'a, 'x, 'px, 'm, 's, 't, 'pt> !Sync for EvalContext<'a, 'x, 'px, 'm, 's, 't, 'pt>

impl<'a, 'x, 'px, 'm, 's, 't, 'pt> Unpin for EvalContext<'a, 'x, 'px, 'm, 's, 't, 'pt> where
    'pt: 't,
    'px: 'x, 

impl<'a, 'x, 'px, 'm, 's, 't, 'pt> !UnwindSafe for EvalContext<'a, 'x, 'px, 'm, 's, 't, 'pt>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.