AsyncHost

Trait AsyncHost 

Source
pub trait AsyncHost: BaseHost {
    // Required methods
    fn get_mast_forest(
        &self,
        node_digest: &Word,
    ) -> impl FutureMaybeSend<Option<Arc<MastForest>>>;
    fn on_event(
        &mut self,
        process: &ProcessState<'_>,
    ) -> impl FutureMaybeSend<Result<Vec<AdviceMutation>, EventError>>;
}
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 FutureMaybeSend<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 host.

Source

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

Handles the event emitted from the VM and provides advice mutations to be applied to the advice provider.

The event ID is available at the top of the stack (position 0) when this handler is called. This allows the handler to access both the event ID and any additional context data that may have been pushed onto the stack prior to the emit operation.

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§