pub trait AsInstance {
    // Required methods
    fn get_func(&self, name: impl AsRef<str>) -> WasmEdgeResult<Function>;
    fn func_len(&self) -> u32;
    fn func_names(&self) -> Option<Vec<String>>;
    fn get_table(&self, name: impl AsRef<str>) -> WasmEdgeResult<Table>;
    fn table_len(&self) -> u32;
    fn table_names(&self) -> Option<Vec<String>>;
    fn get_memory(&self, name: impl AsRef<str>) -> WasmEdgeResult<Memory>;
    fn mem_len(&self) -> u32;
    fn mem_names(&self) -> Option<Vec<String>>;
    fn get_global(&self, name: impl AsRef<str>) -> WasmEdgeResult<Global>;
    fn global_len(&self) -> u32;
    fn global_names(&self) -> Option<Vec<String>>;
}
Expand description

The object as an module instance is required to implement this trait.

Required Methods§

source

fn get_func(&self, name: impl AsRef<str>) -> WasmEdgeResult<Function>

Returns the exported function instance by name.

Argument
Error

If fail to find the target function, then an error is returned.

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_table(&self, name: impl AsRef<str>) -> WasmEdgeResult<Table>

Returns the exported table instance by name.

Argument
Error

If fail to find the target table instance, then an error is returned.

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 get_memory(&self, name: impl AsRef<str>) -> WasmEdgeResult<Memory>

Returns the exported memory instance by name.

Argument
Error

If fail to find the target memory instance, then an error is returned.

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 get_global(&self, name: impl AsRef<str>) -> WasmEdgeResult<Global>

Returns the exported global instance by name.

Argument
Error

If fail to find the target global instance, then an error is returned.

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.

Object Safety§

This trait is not object safe.

Implementors§