pub struct AsyncImportObject<T: Send>(/* private fields */);
Available on crate feature
async
and Linux only.Implementations§
Source§impl<T: Send> AsyncImportObject<T>
impl<T: Send> AsyncImportObject<T>
pub fn create(name: impl AsRef<str>, data: Box<T>) -> WasmEdgeResult<Self>
pub fn add_async_func(&mut self, name: impl AsRef<str>, func: AsyncFunction)
Methods from Deref<Target = ImportModule<T>>§
Sourcepub unsafe fn as_raw(&self) -> *mut WasmEdge_ModuleInstanceContext
pub unsafe fn as_raw(&self) -> *mut WasmEdge_ModuleInstanceContext
§Safety
Provides a raw pointer to the inner module instance context. The lifetime of the returned pointer must not exceed that of the object itself.
pub fn get_host_data(&self) -> &T
pub fn get_host_data_mut(&mut self) -> &mut T
pub fn add_func(&mut self, name: impl AsRef<str>, func: Function)
pub fn add_table(&mut self, name: impl AsRef<str>, table: Table)
pub fn add_memory(&mut self, name: impl AsRef<str>, memory: Memory)
pub fn add_global(&mut self, name: impl AsRef<str>, global: Global)
Trait Implementations§
Source§impl<T: Send> AsInstance for AsyncImportObject<T>
impl<T: Send> AsInstance for AsyncImportObject<T>
Source§fn get_table(
&self,
name: impl AsRef<str>,
) -> WasmEdgeResult<InnerRef<Table, &Self>>where
Self: Sized,
fn get_table(
&self,
name: impl AsRef<str>,
) -> WasmEdgeResult<InnerRef<Table, &Self>>where
Self: Sized,
Returns the exported table instance by name. Read more
Source§fn get_memory_ref(
&self,
name: impl AsRef<str>,
) -> WasmEdgeResult<InnerRef<Memory, &Self>>where
Self: Sized,
fn get_memory_ref(
&self,
name: impl AsRef<str>,
) -> WasmEdgeResult<InnerRef<Memory, &Self>>where
Self: Sized,
Returns the exported memory instance by name. Read more
fn get_memory_mut(
&mut self,
name: impl AsRef<str>,
) -> WasmEdgeResult<InnerRef<Memory, &mut Self>>where
Self: Sized,
Source§fn get_global(
&self,
name: impl AsRef<str>,
) -> WasmEdgeResult<InnerRef<Global, &Self>>where
Self: Sized,
fn get_global(
&self,
name: impl AsRef<str>,
) -> WasmEdgeResult<InnerRef<Global, &Self>>where
Self: Sized,
Returns the exported global instance by name. Read more
fn get_global_mut(
&mut self,
name: impl AsRef<str>,
) -> WasmEdgeResult<InnerRef<Global, &mut Self>>where
Self: Sized,
Source§fn func_len(&self) -> u32
fn func_len(&self) -> u32
Returns the length of the exported function instances in this module instance.
Source§fn func_names(&self) -> Option<Vec<String>>
fn func_names(&self) -> Option<Vec<String>>
Returns the names of the exported function instances in this module instance.
Source§fn get_func(&self, name: &str) -> WasmEdgeResult<FuncRef<&Instance>>
fn get_func(&self, name: &str) -> WasmEdgeResult<FuncRef<&Instance>>
Returns the exported function instance by name. Read more
Source§fn get_func_mut(&mut self, name: &str) -> WasmEdgeResult<FuncRef<&mut Instance>>
fn get_func_mut(&mut self, name: &str) -> WasmEdgeResult<FuncRef<&mut Instance>>
Returns the exported function instance by name. Read more
Source§fn table_len(&self) -> u32
fn table_len(&self) -> u32
Returns the length of the exported table instances in this module instance.
Source§fn table_names(&self) -> Option<Vec<String>>
fn table_names(&self) -> Option<Vec<String>>
Returns the names of the exported table instances in this module instance.
Source§fn mem_len(&self) -> u32
fn mem_len(&self) -> u32
Returns the length of the exported memory instances in this module instance.
Source§fn mem_names(&self) -> Option<Vec<String>>
fn mem_names(&self) -> Option<Vec<String>>
Returns the names of all exported memory instances in this module instance.
Source§fn global_len(&self) -> u32
fn global_len(&self) -> u32
Returns the length of the exported global instances in this module instance.
Source§fn global_names(&self) -> Option<Vec<String>>
fn global_names(&self) -> Option<Vec<String>>
Returns the names of the exported global instances in this module instance.
Source§impl AsMut<AsyncImportObject<WasiCtx>> for AsyncWasiModule
impl AsMut<AsyncImportObject<WasiCtx>> for AsyncWasiModule
Source§fn as_mut(&mut self) -> &mut AsyncImportObject<WasiCtx>
fn as_mut(&mut self) -> &mut AsyncImportObject<WasiCtx>
Converts this type into a mutable reference of the (usually inferred) input type.
Source§impl<T: Send> AsMut<ImportModule<T>> for AsyncImportObject<T>
impl<T: Send> AsMut<ImportModule<T>> for AsyncImportObject<T>
Source§fn as_mut(&mut self) -> &mut ImportModule<T>
fn as_mut(&mut self) -> &mut ImportModule<T>
Converts this type into a mutable reference of the (usually inferred) input type.
Source§impl AsRef<AsyncImportObject<WasiCtx>> for AsyncWasiModule
impl AsRef<AsyncImportObject<WasiCtx>> for AsyncWasiModule
Source§fn as_ref(&self) -> &AsyncImportObject<WasiCtx>
fn as_ref(&self) -> &AsyncImportObject<WasiCtx>
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl<T: Send> AsRef<ImportModule<T>> for AsyncImportObject<T>
impl<T: Send> AsRef<ImportModule<T>> for AsyncImportObject<T>
Source§fn as_ref(&self) -> &ImportModule<T>
fn as_ref(&self) -> &ImportModule<T>
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl<T: Send> Deref for AsyncImportObject<T>
impl<T: Send> Deref for AsyncImportObject<T>
Auto Trait Implementations§
impl<T> Freeze for AsyncImportObject<T>
impl<T> RefUnwindSafe for AsyncImportObject<T>where
T: RefUnwindSafe,
impl<T> Send for AsyncImportObject<T>
impl<T> Sync for AsyncImportObject<T>where
T: Sync,
impl<T> Unpin for AsyncImportObject<T>where
T: Unpin,
impl<T> UnwindSafe for AsyncImportObject<T>where
T: UnwindSafe,
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