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§
Implementors§
Source§impl Handler<SwarmMessage> for Agent
Handler implementation for SwarmMessage - enables message processing
impl Handler<SwarmMessage> for Agent
Handler implementation for SwarmMessage - enables message processing