Trait radix_engine::vm::wasm::traits::WasmInstance
source · pub trait WasmInstance {
// Required method
fn invoke_export<'r>(
&mut self,
func_name: &str,
args: Vec<Buffer>,
runtime: &mut Box<dyn WasmRuntime + 'r>
) -> Result<Vec<u8>, InvokeError<WasmRuntimeError>>;
}
Expand description
Represents an instantiated, invocable Scrypto module.
Required Methods§
sourcefn invoke_export<'r>(
&mut self,
func_name: &str,
args: Vec<Buffer>,
runtime: &mut Box<dyn WasmRuntime + 'r>
) -> Result<Vec<u8>, InvokeError<WasmRuntimeError>>
fn invoke_export<'r>( &mut self, func_name: &str, args: Vec<Buffer>, runtime: &mut Box<dyn WasmRuntime + 'r> ) -> Result<Vec<u8>, InvokeError<WasmRuntimeError>>
Invokes an export defined in this module.
The expected signature is as follows:
- The input is a list of U64, each of which represents a
(BufferId, BufferLen)
. - The return data is U64, which represents a
(SlicePtr, SliceLen)
.
The return data is copied into a Vec<u8>
.