pub struct VmState { /* private fields */ }Expand description
The state of a Vm.
Virtual machines are garbage collected types, which requires interior mutability so that the garbage collector can trace what every allocated virtual machine is currently referencing.
Implementations§
source§impl VmState
impl VmState
sourcepub fn set_steps_per_charge(&mut self, steps: u16)
pub fn set_steps_per_charge(&mut self, steps: u16)
Sets the number of virtual machine steps to take per budget being charged.
This also affects how often the virtual machine checks if it should yield to the garbage collector.
sourcepub fn registers_mut(&mut self) -> &mut [Value; 256]
pub fn registers_mut(&mut self) -> &mut [Value; 256]
Returns exclusive access to the registers.
sourcepub fn current_module(&self) -> ModuleId
pub fn current_module(&self) -> ModuleId
Returns the id of the module that owns the code currently executing.
sourcepub fn root_module(&self) -> Dynamic<Module>
pub fn root_module(&self) -> Dynamic<Module>
Returns the root module for this virtual machine.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for VmState
impl !RefUnwindSafe for VmState
impl Send for VmState
impl !Sync for VmState
impl Unpin for VmState
impl !UnwindSafe for VmState
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