Trait AsyncHost

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

Analogous to the SyncHost trait, but designed for asynchronous execution contexts.

Required Methods§

Source

fn get_mast_forest( &self, node_digest: &Word, ) -> impl Future<Output = Option<Arc<MastForest>>> + Send

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

Source

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

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§