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
Best-effort hook called after every successful verb dispatch.
The runtime supplies a synthetic EventView whose event describes the
dispatch outcome and whose observations vector is currently empty. Loading
persisted provenance observations belongs to an explicit caller or the
deferred event-consumer contract; this hook does not provide it.
Required Methods§
Sourcefn 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,
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".