pub trait AsInstance {
    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§

Returns the exported function instance by name.

Argument
Error

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

Returns the length of the exported function instances in this module instance.

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

Returns the exported table instance by name.

Argument
Error

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

Returns the length of the exported table instances in this module instance.

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

Returns the exported memory instance by name.

Argument
Error

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

Returns the length of the exported memory instances in this module instance.

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

Returns the exported global instance by name.

Argument
Error

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

Returns the length of the exported global instances in this module instance.

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

Implementors§