Struct rhai::EvalContext
source · [−]pub struct EvalContext<'a, 's, 'ps, 'm, 'pm, 'c, 't, 'pt> { /* private fields */ }
Expand description
Context of a script evaluation process.
Implementations
sourceimpl EvalContext<'_, '_, '_, '_, '_, '_, '_, '_>
impl EvalContext<'_, '_, '_, '_, '_, '_, '_, '_>
sourcepub fn eval_expression_tree(
&mut self,
expr: &Expression<'_>
) -> Result<Dynamic, Box<EvalAltResult>>
pub fn eval_expression_tree(
&mut self,
expr: &Expression<'_>
) -> Result<Dynamic, Box<EvalAltResult>>
Evaluate an expression tree.
WARNING - Low Level API
This function is very low level. It evaluates an expression from an AST
.
sourceimpl<'s, 'ps, 'm, 'pm, 'pt> EvalContext<'_, 's, 'ps, 'm, 'pm, '_, '_, 'pt>
impl<'s, 'ps, 'm, 'pm, 'pt> EvalContext<'_, 's, 'ps, 'm, 'pm, '_, '_, 'pt>
sourcepub fn scope_mut(&mut self) -> &mut &'s mut Scope<'ps>
pub fn scope_mut(&mut self) -> &mut &'s mut Scope<'ps>
Get a mutable reference to the current Scope
.
sourcepub fn iter_imports(&self) -> impl Iterator<Item = (&str, &Module)>
pub fn iter_imports(&self) -> impl Iterator<Item = (&str, &Module)>
Get an iterator over the current set of modules imported via import
statements,
in reverse order (i.e. modules imported last come first).
sourcepub fn tag_mut(&mut self) -> &mut Dynamic
pub fn tag_mut(&mut self) -> &mut Dynamic
Mutable reference to the custom state kept in a Dynamic
.
sourcepub const fn global_runtime_state(&self) -> &GlobalRuntimeState<'_>
pub const fn global_runtime_state(&self) -> &GlobalRuntimeState<'_>
(internals) The current GlobalRuntimeState
.
Exported under the internals
feature only.
sourcepub fn global_runtime_state_mut(
&mut self
) -> &mut &'m mut GlobalRuntimeState<'pm>
pub fn global_runtime_state_mut(
&mut self
) -> &mut &'m mut GlobalRuntimeState<'pm>
(internals) Get a mutable reference to the current GlobalRuntimeState
.
Exported under the internals
feature only.
sourcepub fn iter_namespaces(&self) -> impl Iterator<Item = &Module>
pub fn iter_namespaces(&self) -> impl Iterator<Item = &Module>
Get an iterator over the namespaces containing definition of all script-defined functions.
sourcepub const fn namespaces(&self) -> &[&Module]
pub const fn namespaces(&self) -> &[&Module]
(internals) The current set of namespaces containing definitions of all script-defined functions.
Exported under the internals
feature only.
sourcepub fn this_ptr_mut(&mut self) -> Option<&mut &'pt mut Dynamic>
pub fn this_ptr_mut(&mut self) -> Option<&mut &'pt mut Dynamic>
Mutable reference to the current bound this
pointer, if any.
sourcepub const fn call_level(&self) -> usize
pub const fn call_level(&self) -> usize
The current nesting level of function calls.
Trait Implementations
Auto Trait Implementations
impl<'a, 's, 'ps, 'm, 'pm, 'c, 't, 'pt> !RefUnwindSafe for EvalContext<'a, 's, 'ps, 'm, 'pm, 'c, 't, 'pt>
impl<'a, 's, 'ps, 'm, 'pm, 'c, 't, 'pt> !Send for EvalContext<'a, 's, 'ps, 'm, 'pm, 'c, 't, 'pt>
impl<'a, 's, 'ps, 'm, 'pm, 'c, 't, 'pt> !Sync for EvalContext<'a, 's, 'ps, 'm, 'pm, 'c, 't, 'pt>
impl<'a, 's, 'ps, 'm, 'pm, 'c, 't, 'pt> Unpin for EvalContext<'a, 's, 'ps, 'm, 'pm, 'c, 't, 'pt> where
'pm: 'm,
'ps: 's,
'pt: 't,
impl<'a, 's, 'ps, 'm, 'pm, 'c, 't, 'pt> !UnwindSafe for EvalContext<'a, 's, 'ps, 'm, 'pm, 'c, 't, 'pt>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more