pub struct VM { /* private fields */ }Expand description
A stack based Virtual Machine.
The stack size is limited to avoid cache misses, which drastically reduce performance. For the intended purpose (short inline scripting) this size should be enough.
Implementations§
Source§impl VM
impl VM
Sourcepub fn run(
&mut self,
chunk: &Chunk,
globals: &mut dyn Environment,
stdout: &mut impl Write,
) -> Result<ScriptingValue, Error>
pub fn run( &mut self, chunk: &Chunk, globals: &mut dyn Environment, stdout: &mut impl Write, ) -> Result<ScriptingValue, Error>
Execute a Chunk with the virtual machine,
Returns the topmost stack ScriptingValue if there is one, otherwise ScriptingValue::nil().
§Errors
- unknown
OpCode
Trait Implementations§
Auto Trait Implementations§
impl Freeze for VM
impl RefUnwindSafe for VM
impl Send for VM
impl Sync for VM
impl Unpin for VM
impl UnwindSafe for VM
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