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:
- accessing the advice provider,
- getting a library’s MAST forest,
- handling VM events (which can mutate the process’ advice provider), and
- handling debug and trace events.
Required Methods§
Sourcefn on_event(
&mut self,
process: &ProcessState<'_>,
event_id: u32,
) -> Result<Vec<AdviceMutation>, EventError>
fn on_event( &mut self, process: &ProcessState<'_>, event_id: u32, ) -> Result<Vec<AdviceMutation>, EventError>
Handles the event emitted from the VM.