dharitri_vm_executor

Trait Executor

Source
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§

Source

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.

Source

fn set_opcode_cost( &mut self, opcode_cost: &OpcodeCost, ) -> Result<(), ExecutorError>

Sets the opcode costs for the given executor.

Source

fn new_instance( &self, wasm_bytes: &[u8], compilation_options: &CompilationOptions, ) -> Result<Box<dyn Instance>, ExecutorError>

Creates a new VM executor instance.

Source

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.

Implementors§