pub trait Handler<M>: Actor {
type Response: Send + Sync;
// Required method
fn handle<'life0, 'async_trait>(
&'life0 mut self,
message: M,
) -> Pin<Box<dyn Future<Output = Result<Self::Response>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Handler trait for processing messages in the swarm
A Handler can receive and process messages of a specific type. This enables actors to respond to different message types.
Required Associated Types§
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".