Struct wasmedge_sys::plugin::PluginModule
source · pub struct PluginModule { /* private fields */ }
Expand description
Represents a Plugin module instance.
Implementations§
source§impl PluginModule
impl PluginModule
sourcepub fn create<T>(
name: impl AsRef<str>,
host_data: Option<Box<T>>
) -> WasmEdgeResult<Self>where
T: ?Sized + Send + Sync + Clone,
pub fn create<T>( name: impl AsRef<str>, host_data: Option<Box<T>> ) -> WasmEdgeResult<Self>where T: ?Sized + Send + Sync + Clone,
Creates a module instance which is used to import host functions, tables, memories, and globals into a wasm module.
Argument
-
name
- The name of the import module instance. -
host_data
- The host context data to be used in the module instance. -
finalizer
- the function to drop the host data. This argument is only available whenhost_data
is set.
Error
If fail to create the import module instance, then an error is returned.
sourcepub fn as_raw_ptr(&self) -> *const WasmEdge_ModuleInstanceContext
Available on crate feature ffi
only.
pub fn as_raw_ptr(&self) -> *const WasmEdge_ModuleInstanceContext
ffi
only.Provides a raw pointer to the inner module instance context.
Trait Implementations§
source§impl AsImport for PluginModule
impl AsImport for PluginModule
source§fn add_func(&mut self, name: impl AsRef<str>, func: Function)
fn add_func(&mut self, name: impl AsRef<str>, func: Function)
Imports a host function instance. Read more
source§fn add_table(&mut self, name: impl AsRef<str>, table: Table)
fn add_table(&mut self, name: impl AsRef<str>, table: Table)
Imports a table instance. Read more
source§fn add_memory(&mut self, name: impl AsRef<str>, memory: Memory)
fn add_memory(&mut self, name: impl AsRef<str>, memory: Memory)
Imports a memory instance. Read more
source§fn add_global(&mut self, name: impl AsRef<str>, global: Global)
fn add_global(&mut self, name: impl AsRef<str>, global: Global)
Imports a global instance. Read more
source§impl Clone for PluginModule
impl Clone for PluginModule
source§fn clone(&self) -> PluginModule
fn clone(&self) -> PluginModule
Returns a copy 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 Debug for PluginModule
impl Debug for PluginModule
Auto Trait Implementations§
impl !RefUnwindSafe for PluginModule
impl Send for PluginModule
impl Sync for PluginModule
impl Unpin for PluginModule
impl !UnwindSafe for PluginModule
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