Skip to main content

DispatchHook

Trait DispatchHook 

Source
pub trait DispatchHook: Send + Sync {
    // Required method
    fn on_dispatch<'life0, 'life1, 'async_trait>(
        &'life0 self,
        view: &'life1 EventView,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Hook called after every successful verb dispatch (Issue #158).

Packs observe enriched event views so provenance-aware consumers can use view.observations while legacy folds can still consume view.event.

Required Methods§

Source

fn on_dispatch<'life0, 'life1, 'async_trait>( &'life0 self, view: &'life1 EventView, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Called with the dispatch-outcome event view after a successful pack dispatch.

Errors are logged via tracing::warn! and never propagated to the caller; the dispatch has already succeeded.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§