pub struct Context { /* private fields */ }Expand description
Evaluation context
Holds variable bindings and other state needed during evaluation. Uses a scope stack for efficient push/pop instead of clone/restore.
Implementations§
Source§impl Context
impl Context
pub fn new() -> Self
pub fn bind(&mut self, name: String, value: JValue)
pub fn bind_lambda(&mut self, name: String, lambda: StoredLambda)
pub fn unbind(&mut self, name: &str)
pub fn lookup(&self, name: &str) -> Option<&JValue>
pub fn lookup_lambda(&self, name: &str) -> Option<&StoredLambda>
pub fn set_parent(&mut self, data: JValue)
pub fn get_parent(&self) -> Option<&JValue>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Context
impl RefUnwindSafe for Context
impl !Send for Context
impl !Sync for Context
impl Unpin for Context
impl UnsafeUnpin for Context
impl UnwindSafe for Context
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