pub struct VmEnv { /* private fields */ }Expand description
Variable environment passed to the VM at execution time.
The VM does not modify the caller’s environment; StoreVar writes into
a local clone that is discarded when execution ends.
Implementations§
Source§impl VmEnv
impl VmEnv
Sourcepub fn set(&mut self, name: impl Into<String>, val: VmValue)
pub fn set(&mut self, name: impl Into<String>, val: VmValue)
Bind a variable to an arbitrary VmValue.
Sourcepub fn set_num(&mut self, name: impl Into<String>, val: f64)
pub fn set_num(&mut self, name: impl Into<String>, val: f64)
Convenience helper: bind a variable to a numeric value.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for VmEnv
impl RefUnwindSafe for VmEnv
impl Send for VmEnv
impl Sync for VmEnv
impl Unpin for VmEnv
impl UnsafeUnpin for VmEnv
impl UnwindSafe for VmEnv
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