pub struct Context {
pub global_object: Object,
pub variables: HashMap<String, Value>,
pub this_value: Value,
pub heap: Option<Heap>,
}Fields§
§global_object: Object§variables: HashMap<String, Value>§this_value: Value§heap: Option<Heap>Implementations§
Source§impl Context
impl Context
pub fn new() -> Self
pub fn set_variable(&mut self, name: String, value: Value)
pub fn get_variable(&self, name: &str) -> Option<&Value>
pub fn has_variable(&self, name: &str) -> bool
pub fn set_this(&mut self, value: Value)
pub fn get_this(&self) -> &Value
pub fn set_heap(&mut self, heap: Heap)
pub fn get_heap(&mut self) -> Option<&mut Heap>
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 !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