Trait SyncHost

Source
pub trait SyncHost: BaseHost {
    // Required methods
    fn get_mast_forest(&self, node_digest: &Word) -> Option<Arc<MastForest>>;
    fn on_event(
        &mut self,
        process: &mut ProcessState<'_>,
        event_id: u32,
        err_ctx: &impl ErrorContext,
    ) -> Result<(), ExecutionError>;
}
Expand description

Defines an interface by which the VM can interact with the host.

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

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

Required Methods§

Source

fn get_mast_forest(&self, node_digest: &Word) -> Option<Arc<MastForest>>

Returns MAST forest corresponding to the specified digest, or None if the MAST forest for this digest could not be found in this SyncHost.

Source

fn on_event( &mut self, process: &mut ProcessState<'_>, event_id: u32, err_ctx: &impl ErrorContext, ) -> Result<(), ExecutionError>

Handles the event emitted from the VM.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§