pub struct Environment<'a>(/* private fields */);
Implementations§
Source§impl Environment<'_>
impl Environment<'_>
pub fn from_raw_pointer(raw_pointer: EnvironmentPointer) -> Result<Self>
pub fn from_instance(instance: &Instance<'_>) -> Result<Self>
pub fn get_or_initialize_custom_data(&self) -> Result<&CustomData>
Sourcepub unsafe fn convert_to_native_pointer<T>(
&self,
address: WasmPointer,
) -> Option<*mut T>
pub unsafe fn convert_to_native_pointer<T>( &self, address: WasmPointer, ) -> Option<*mut T>
§Safety
This function is unsafe because it is not checked that the address is valid.
Please use Validate_WASM_pointer
to check the address.
Sourcepub unsafe fn convert_to_wasm_pointer<T>(
&self,
pointer: *const T,
) -> WasmPointer
pub unsafe fn convert_to_wasm_pointer<T>( &self, pointer: *const T, ) -> WasmPointer
§Safety
This function is unsafe because it is not checked that the address is valid.
Please use Validate_WASM_pointer
to check the address.
pub fn validate_wasm_pointer( &self, address: WasmPointer, size: WasmUsize, ) -> bool
pub fn validate_native_pointer<T>(&self, pointer: *const T, size: u64) -> bool
Sourcepub fn call_indirect_function(
&self,
function_index: u32,
parameters: &Vec<WasmValue>,
) -> Result<()>
pub fn call_indirect_function( &self, function_index: u32, parameters: &Vec<WasmValue>, ) -> Result<()>
Make an indirect function call (call a function by its index which is not exported).
For exported functions use Call_export_function
.
Sourcepub fn create_environment(&self, stack_size: usize) -> Result<Self>
pub fn create_environment(&self, stack_size: usize) -> Result<Self>
Create a new execution environment.
This environment should be initialized with Initialize_thread_environment
and deinitialized with Deinitialize_thread_environment
.
Trait Implementations§
Source§impl<'a> Clone for Environment<'a>
impl<'a> Clone for Environment<'a>
Source§fn clone(&self) -> Environment<'a>
fn clone(&self) -> Environment<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'a> Debug for Environment<'a>
impl<'a> Debug for Environment<'a>
impl<'a> Copy for Environment<'a>
impl Send for Environment<'_>
impl Sync for Environment<'_>
Auto Trait Implementations§
impl<'a> Freeze for Environment<'a>
impl<'a> RefUnwindSafe for Environment<'a>
impl<'a> Unpin for Environment<'a>
impl<'a> UnwindSafe for Environment<'a>
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