SyncHost

Trait SyncHost 

Source
pub trait SyncHost: BaseHost {
    // Required method
    fn on_event(
        &mut self,
        process: &ProcessState<'_>,
        event_id: u32,
    ) -> Result<Vec<AdviceMutation>, EventError>;
}
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 VM events (which can mutate the process’ advice provider), and
  4. handling debug and trace events.

Required Methods§

Source

fn on_event( &mut self, process: &ProcessState<'_>, event_id: u32, ) -> Result<Vec<AdviceMutation>, EventError>

Handles the event emitted from the VM.

Implementors§

Source§

impl<D, S> SyncHost for DefaultHost<D, S>