Trait sc_executor_common::wasm_runtime::WasmInstance
source · pub trait WasmInstance: Send {
// Required method
fn call_with_allocation_stats(
&mut self,
method: &str,
data: &[u8],
) -> (Result<Vec<u8>, Error>, Option<AllocationStats>);
// Provided methods
fn call(&mut self, method: &str, data: &[u8]) -> Result<Vec<u8>, Error> { ... }
fn call_export(
&mut self,
method: &str,
data: &[u8],
) -> Result<Vec<u8>, Error> { ... }
}
Expand description
A trait that defines an abstract wasm module instance.
This can be implemented by an execution engine.
Required Methods§
sourcefn call_with_allocation_stats(
&mut self,
method: &str,
data: &[u8],
) -> (Result<Vec<u8>, Error>, Option<AllocationStats>)
fn call_with_allocation_stats( &mut self, method: &str, data: &[u8], ) -> (Result<Vec<u8>, Error>, Option<AllocationStats>)
Call a method on this WASM instance.
Before execution, instance is reset.
Returns the encoded result on success.