pub trait Handler<T: Message>: Actorwhere
Self: Sized,{
// Required method
fn handle(
&mut self,
ctx: &mut Context<Self>,
msg: T
) -> impl Future<Output = T::Result> + Send;
}
Expand description
Describes how to handle messages of a specific type.
Implementing Handler is a general way to handle incoming messages.
The type T
is a message which can be handled by the actor.
Required Methods§
Object Safety§
This trait is not object safe.