pub struct Instance<'module> { /* private fields */ }
Implementations§
Source§impl<'module> Instance<'module>
impl<'module> Instance<'module>
pub fn new( runtime: &Runtime, module: &'module Module<'module>, stack_size: usize, ) -> Result<Self>
pub fn validate_native_pointer<T>(&self, pointer: *const T, size: usize) -> bool
pub fn validate_wasm_pointer(&self, address: WasmPointer, size: usize) -> bool
pub fn convert_to_wasm_pointer<T>(&self, pointer: *const T) -> WasmPointer
Sourcepub unsafe fn convert_to_native_pointer<T>(
&self,
address: WasmPointer,
) -> *mut T
pub unsafe fn convert_to_native_pointer<T>( &self, address: WasmPointer, ) -> *mut T
§Safety
This function is unsafe because it is not checked that the address is valid.
pub fn call_export_function( &self, name: &str, parameters: &Vec<WasmValue>, ) -> Result<Vec<WasmValue>>
pub fn call_main(&self, parameters: &Vec<WasmValue>) -> Result<Vec<WasmValue>>
pub fn allocate<T>(&mut self, size: usize) -> Result<*mut T>
pub fn deallocate<T>(&mut self, data: *mut T)
pub fn get_inner_reference(&self) -> &Instance<'_>
Trait Implementations§
Auto Trait Implementations§
impl<'module> Freeze for Instance<'module>
impl<'module> RefUnwindSafe for Instance<'module>
impl<'module> !Sync for Instance<'module>
impl<'module> Unpin for Instance<'module>
impl<'module> UnwindSafe for Instance<'module>
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