Trait wasmedge_sys::AsImport
source · pub trait AsImport {
// Required methods
fn name(&self) -> &str;
fn add_func(&mut self, name: impl AsRef<str>, func: Function);
fn add_table(&mut self, name: impl AsRef<str>, table: Table);
fn add_memory(&mut self, name: impl AsRef<str>, memory: Memory);
fn add_global(&mut self, name: impl AsRef<str>, global: Global);
}
Expand description
The module to be registered via the the Executor::register_import_module function is required to implement this trait.
Required Methods§
sourcefn 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.
Arguments
-
name
- The name of the host function instance to import. -
func
- The host function instance to import.
sourcefn 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.
Arguments
-
name
- The name of the host table instance to import. -
table
- The host table instance to import.
sourcefn 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.
Arguments
-
name
- The name of the host memory instance to import. -
memory
- The host memory instance to import.
sourcefn 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.
Arguments
-
name
- The name of the host global instance to import. -
global
- The host global instance to import.
Object Safety§
This trait is not object safe.