Trait wasmedge_sdk::AsInstance
source · pub trait AsInstance {
Show 13 methods
// Required methods
fn name(&self) -> &str;
fn func_count(&self) -> usize;
fn func_names(&self) -> Option<Vec<String>>;
fn func(&self, name: impl AsRef<str>) -> WasmEdgeResult<Func>;
fn global_count(&self) -> usize;
fn global_names(&self) -> Option<Vec<String>>;
fn global(&self, name: impl AsRef<str>) -> WasmEdgeResult<Global>;
fn memory_count(&self) -> usize;
fn memory_names(&self) -> Option<Vec<String>>;
fn memory(&self, name: impl AsRef<str>) -> WasmEdgeResult<Memory>;
fn table_count(&self) -> usize;
fn table_names(&self) -> Option<Vec<String>>;
fn table(&self, name: impl AsRef<str>) -> WasmEdgeResult<Table>;
}
Expand description
The object used as an module instance is required to implement this trait.
Required Methods§
sourcefn func_count(&self) -> usize
fn func_count(&self) -> usize
Returns the count of the exported function instances in this module instance.
sourcefn 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.
sourcefn func(&self, name: impl AsRef<str>) -> WasmEdgeResult<Func>
fn func(&self, name: impl AsRef<str>) -> WasmEdgeResult<Func>
Returns the exported function instance in this module instance.
Argument
name
- the name of the target exported function instance.
sourcefn global_count(&self) -> usize
fn global_count(&self) -> usize
Returns the count of the exported global instances.
sourcefn 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.
sourcefn global(&self, name: impl AsRef<str>) -> WasmEdgeResult<Global>
fn global(&self, name: impl AsRef<str>) -> WasmEdgeResult<Global>
Returns the exported global instance in this module instance.
Argument
name
- the name of the target exported global instance.
sourcefn memory_count(&self) -> usize
fn memory_count(&self) -> usize
Returns the count of the exported memory instances in this module instance.
sourcefn memory_names(&self) -> Option<Vec<String>>
fn memory_names(&self) -> Option<Vec<String>>
Returns the names of the exported memory instances in this module instance.
sourcefn memory(&self, name: impl AsRef<str>) -> WasmEdgeResult<Memory>
fn memory(&self, name: impl AsRef<str>) -> WasmEdgeResult<Memory>
Returns the exported memory instance in this module instance.
Argument
name
- the name of the target exported memory instance.
sourcefn table_count(&self) -> usize
fn table_count(&self) -> usize
Returns the count of the exported table instances in this module instance.
sourcefn 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.
sourcefn table(&self, name: impl AsRef<str>) -> WasmEdgeResult<Table>
fn table(&self, name: impl AsRef<str>) -> WasmEdgeResult<Table>
Returns the exported table instance in this module instance by the given table name.
Argument
name
- the name of the target exported table instance.