pub trait Executor {
// Required methods
fn set_vm_hooks_ptr(
&mut self,
vm_hooks_ptr: *mut c_void,
) -> Result<(), ExecutorError>;
fn set_opcode_cost(
&mut self,
opcode_cost: &OpcodeCost,
) -> Result<(), ExecutorError>;
fn new_instance(
&self,
wasm_bytes: &[u8],
compilation_options: &CompilationOptions,
) -> Result<Box<dyn Instance>, ExecutorError>;
fn new_instance_from_cache(
&self,
cache_bytes: &[u8],
compilation_options: &CompilationOptions,
) -> Result<Box<dyn Instance>, ExecutorError>;
}
Required Methods§
Sourcefn set_vm_hooks_ptr(
&mut self,
vm_hooks_ptr: *mut c_void,
) -> Result<(), ExecutorError>
fn set_vm_hooks_ptr( &mut self, vm_hooks_ptr: *mut c_void, ) -> Result<(), ExecutorError>
Sets the data that can be hold by an instance context.
Sourcefn set_opcode_cost(
&mut self,
opcode_cost: &OpcodeCost,
) -> Result<(), ExecutorError>
fn set_opcode_cost( &mut self, opcode_cost: &OpcodeCost, ) -> Result<(), ExecutorError>
Sets the opcode costs for the given executor.
Sourcefn new_instance(
&self,
wasm_bytes: &[u8],
compilation_options: &CompilationOptions,
) -> Result<Box<dyn Instance>, ExecutorError>
fn new_instance( &self, wasm_bytes: &[u8], compilation_options: &CompilationOptions, ) -> Result<Box<dyn Instance>, ExecutorError>
Creates a new VM executor instance.
Sourcefn new_instance_from_cache(
&self,
cache_bytes: &[u8],
compilation_options: &CompilationOptions,
) -> Result<Box<dyn Instance>, ExecutorError>
fn new_instance_from_cache( &self, cache_bytes: &[u8], compilation_options: &CompilationOptions, ) -> Result<Box<dyn Instance>, ExecutorError>
Creates a new VM executor instance from cache.