pub trait WaterfallMiddleware<E, T>:
Send
+ Sync
+ 'static{
// Required method
fn handle<'a>(
self: Arc<Self>,
event: &'a E,
value: T,
next: WaterfallNext<'a, T>,
) -> BoxFuture<'a, Flow<T>>;
}Expand description
One step of a waterfall chain over event E and value T.
The self: Arc<Self> receiver lets the continuation own the middleware
across await points without borrowing it, keeping the chain composable
for any handler lifetime.
Required Methods§
fn handle<'a>( self: Arc<Self>, event: &'a E, value: T, next: WaterfallNext<'a, T>, ) -> BoxFuture<'a, Flow<T>>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".