Trait sc_executor_common::wasm_runtime::WasmInstance[][src]

pub trait WasmInstance: Send {
    fn call(
        &self,
        method: InvokeMethod<'_>,
        data: &[u8]
    ) -> Result<Vec<u8>, Error>;
fn get_global_const(&self, name: &str) -> Result<Option<Value>, Error>; fn call_export(&self, method: &str, data: &[u8]) -> Result<Vec<u8>, Error> { ... } }

A trait that defines an abstract wasm module instance.

This can be implemented by an execution engine.

Required methods

fn call(&self, method: InvokeMethod<'_>, data: &[u8]) -> Result<Vec<u8>, Error>[src]

Call a method on this WASM instance.

Before execution, instance is reset.

Returns the encoded result on success.

fn get_global_const(&self, name: &str) -> Result<Option<Value>, Error>[src]

Get the value from a global with the given name.

This method is only suitable for getting immutable globals.

Loading content...

Provided methods

fn call_export(&self, method: &str, data: &[u8]) -> Result<Vec<u8>, Error>[src]

Call an exported method on this WASM instance.

Before execution, instance is reset.

Returns the encoded result on success.

Loading content...

Implementors

Loading content...