wasmedge_sys::async::module

Struct AsyncImportObject

Source
pub struct AsyncImportObject<T: Send>(/* private fields */);
Available on crate feature async and Linux only.

Implementations§

Source§

impl<T: Send> AsyncImportObject<T>

Source

pub fn create(name: impl AsRef<str>, data: Box<T>) -> WasmEdgeResult<Self>

Source

pub fn add_async_func(&mut self, name: impl AsRef<str>, func: AsyncFunction)

Methods from Deref<Target = ImportModule<T>>§

Source

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.

Source

pub fn get_host_data(&self) -> &T

Source

pub fn get_host_data_mut(&mut self) -> &mut T

Source

pub fn add_func(&mut self, name: impl AsRef<str>, func: Function)

Source

pub fn add_table(&mut self, name: impl AsRef<str>, table: Table)

Source

pub fn add_memory(&mut self, name: impl AsRef<str>, memory: Memory)

Source

pub fn add_global(&mut self, name: impl AsRef<str>, global: Global)

Trait Implementations§

Source§

impl<T: Send> AsInstance for AsyncImportObject<T>

Source§

unsafe fn as_ptr(&self) -> *const WasmEdge_ModuleInstanceContext

Safety Read more
Source§

fn name(&self) -> Option<String>

Returns the name of this exported module instance. Read more
Source§

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,

Returns the exported memory instance by name. Read more
Source§

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,

Returns the exported global instance by name. Read more
Source§

fn get_global_mut( &mut self, name: impl AsRef<str>, ) -> WasmEdgeResult<InnerRef<Global, &mut Self>>
where Self: Sized,

Source§

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>>

Returns the names of the exported function instances in this module instance.
Source§

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>>

Returns the exported function instance by name. Read more
Source§

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>>

Returns the names of the exported table instances in this module instance.
Source§

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>>

Returns the names of all exported memory instances in this module instance.
Source§

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>>

Returns the names of the exported global instances in this module instance.
Source§

impl AsMut<AsyncImportObject<WasiCtx>> for AsyncWasiModule

Source§

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>

Source§

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

Source§

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>

Source§

fn as_ref(&self) -> &ImportModule<T>

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<T: Debug + Send> Debug for AsyncImportObject<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: Send> Deref for AsyncImportObject<T>

Source§

type Target = ImportModule<T>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<T: Send> DerefMut for AsyncImportObject<T>

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.

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> 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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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.