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:
- accessing the advice provider,
- getting a library’s MAST forest,
- handling advice events (which internally mutates the advice provider), and
- handling debug and trace events.
Required Methods§
Sourcefn get_mast_forest(&self, node_digest: &Word) -> Option<Arc<MastForest>>
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.
Sourcefn on_event(
&mut self,
process: &mut ProcessState<'_>,
event_id: u32,
err_ctx: &impl ErrorContext,
) -> Result<(), ExecutionError>
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.