pub struct VMWrapper(/* private fields */);
Expand description
High-level wrapper around a Wren VM
Implementations§
source§impl VMWrapper
impl VMWrapper
sourcepub fn call(&self, signature: FunctionSignature) -> Result<(), VMError>
pub fn call(&self, signature: FunctionSignature) -> Result<(), VMError>
Calls a given function from its signature
sourcepub fn call_handle(&self, handle: &FunctionHandle<'_>) -> Result<(), VMError>
pub fn call_handle(&self, handle: &FunctionHandle<'_>) -> Result<(), VMError>
Calls a given function from its handle
sourcepub fn interpret<M: AsRef<str>, C: AsRef<str>>(
&self,
module: M,
code: C
) -> Result<(), VMError>
pub fn interpret<M: AsRef<str>, C: AsRef<str>>( &self, module: M, code: C ) -> Result<(), VMError>
Interprets a given string as Wren code
sourcepub fn get_slot_handle(&self, slot: SlotId) -> Rc<Handle<'_>>
pub fn get_slot_handle(&self, slot: SlotId) -> Rc<Handle<'_>>
Gets a handle to a value in a certain slot
sourcepub fn set_slot_handle(&self, slot: SlotId, handle: &Handle<'_>)
pub fn set_slot_handle(&self, slot: SlotId, handle: &Handle<'_>)
Sets the value in a certain slot to the value of a handle
sourcepub fn make_call_handle(
&self,
signature: FunctionSignature
) -> Rc<FunctionHandle<'_>>
pub fn make_call_handle( &self, signature: FunctionSignature ) -> Rc<FunctionHandle<'_>>
Create a callable handle, that can be used with call_handle
sourcepub fn collect_garbage(&self)
pub fn collect_garbage(&self)
Instruct Wren to start a garbage collection cycle
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for VMWrapper
impl !Send for VMWrapper
impl !Sync for VMWrapper
impl Unpin for VMWrapper
impl !UnwindSafe for VMWrapper
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