pub trait MessageHandler<T: Send + Sync + 'static>:
Send
+ Sync
+ 'static {
// Required method
fn handle<'life0, 'async_trait>(
&'life0 self,
msg: Message<T>,
) -> Pin<Box<dyn Future<Output = AppResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Handler for processing consumed messages.
Implement this trait to define how incoming messages are processed.
For simple cases, use FnHandler to wrap a closure.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".