Trait BaseHost

Source
pub trait BaseHost {
    // Provided methods
    fn on_debug(
        &mut self,
        process: &mut ProcessState<'_>,
        options: &DebugOptions,
    ) -> Result<(), ExecutionError> { ... }
    fn on_trace(
        &mut self,
        process: &mut ProcessState<'_>,
        trace_id: u32,
    ) -> Result<(), ExecutionError> { ... }
    fn on_assert_failed(
        &mut self,
        _process: &mut ProcessState<'_>,
        _err_code: Felt,
    ) { ... }
}
Expand description

Defines the common interface between SyncHost and AsyncHost, by which the VM can interact with the host.

There are three main categories of interactions between the VM and the host:

  1. getting a library’s MAST forest,
  2. handling advice events (which internally mutates the advice provider), and
  3. handling debug and trace events.

Provided Methods§

Source

fn on_debug( &mut self, process: &mut ProcessState<'_>, options: &DebugOptions, ) -> Result<(), ExecutionError>

Handles the debug request from the VM.

Source

fn on_trace( &mut self, process: &mut ProcessState<'_>, trace_id: u32, ) -> Result<(), ExecutionError>

Handles the trace emitted from the VM.

Source

fn on_assert_failed(&mut self, _process: &mut ProcessState<'_>, _err_code: Felt)

Handles the failure of the assertion instruction.

Implementors§