Virtual_machine

Struct Instance_type

Source
pub struct Instance_type<'module> { /* private fields */ }

Implementations§

Source§

impl<'module> Instance_type<'module>

Source

pub fn New( Runtime: &Runtime_type, Module: &'module Module_type<'module>, Stack_size: usize, ) -> Result_type<Self>

Source

pub fn Validate_native_pointer<T>(&self, Pointer: *const T, Size: usize) -> bool

Source

pub fn Validate_WASM_pointer( &self, Address: WASM_pointer_type, Size: usize, ) -> bool

Source

pub fn Convert_to_WASM_pointer<T>(&self, Pointer: *const T) -> WASM_pointer_type

Source

pub unsafe fn Convert_to_native_pointer<T>( &self, Address: WASM_pointer_type, ) -> *mut T

§Safety

This function is unsafe because it is not checked that the address is valid.

Source

pub fn Call_export_function( &self, Name: &str, Parameters: &Vec<WasmValue>, ) -> Result_type<Vec<WasmValue>>

Source

pub fn Call_main( &self, Parameters: &Vec<WasmValue>, ) -> Result_type<Vec<WasmValue>>

Source

pub fn Allocate<T>(&mut self, Size: usize) -> Result_type<*mut T>

Source

pub fn Deallocate<T>(&mut self, Data: *mut T)

Trait Implementations§

Source§

impl Drop for Instance_type<'_>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Send for Instance_type<'_>

Auto Trait Implementations§

§

impl<'module> Freeze for Instance_type<'module>

§

impl<'module> RefUnwindSafe for Instance_type<'module>

§

impl<'module> !Sync for Instance_type<'module>

§

impl<'module> Unpin for Instance_type<'module>

§

impl<'module> UnwindSafe for Instance_type<'module>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.