Struct casbin::rhai::EvalContext
source · pub struct EvalContext<'a, 's, 'ps, 'g, 'c, 't> { /* private fields */ }
Expand description
Context of a script evaluation process.
Implementations§
source§impl<'a, 's, 'ps, 'g, 'c, 't> EvalContext<'a, 's, 'ps, 'g, 'c, 't>
impl<'a, 's, 'ps, 'g, 'c, 't> EvalContext<'a, 's, 'ps, 'g, 'c, 't>
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 fn this_ptr_mut(&mut self) -> Option<&mut Dynamic>
pub fn this_ptr_mut(&mut self) -> Option<&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.
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 within this evaluation context.
§WARNING - Low Level API
This function is very low level. It evaluates an expression from an AST
.
sourcepub fn eval_expression_tree_raw(
&mut self,
expr: &Expression<'_>,
rewind_scope: bool,
) -> Result<Dynamic, Box<EvalAltResult>>
👎Deprecated: This API is NOT deprecated, but it is considered volatile and may change in the future.
pub fn eval_expression_tree_raw( &mut self, expr: &Expression<'_>, rewind_scope: bool, ) -> Result<Dynamic, Box<EvalAltResult>>
Evaluate an expression tree within this evaluation context.
The following option is available:
- whether to rewind the
Scope
after evaluation if the expression is a [StmtBlock
][crate::ast::StmtBlock]
§WARNING - Unstable API
This API is volatile and may change in the future.
§WARNING - Low Level API
This function is extremely low level. It evaluates an expression from an AST
.
Auto Trait Implementations§
impl<'a, 's, 'ps, 'g, 'c, 't> Freeze for EvalContext<'a, 's, 'ps, 'g, 'c, 't>
impl<'a, 's, 'ps, 'g, 'c, 't> !RefUnwindSafe for EvalContext<'a, 's, 'ps, 'g, 'c, 't>
impl<'a, 's, 'ps, 'g, 'c, 't> Send for EvalContext<'a, 's, 'ps, 'g, 'c, 't>
impl<'a, 's, 'ps, 'g, 'c, 't> Sync for EvalContext<'a, 's, 'ps, 'g, 'c, 't>
impl<'a, 's, 'ps, 'g, 'c, 't> Unpin for EvalContext<'a, 's, 'ps, 'g, 'c, 't>
impl<'a, 's, 'ps, 'g, 'c, 't> !UnwindSafe for EvalContext<'a, 's, 'ps, 'g, 'c, 't>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more