pub trait Handler<M>: Actorwhere
M: Message,{
type Result: MessageResponse<Self, M>;
// Required method
fn handle(
&mut self,
msg: M,
ctx: &mut Self::Context,
) -> impl Future<Output = Self::Result> + Send;
}Expand description
Describes how an actor handles a specific message type.
Required Associated Types§
Sourcetype Result: MessageResponse<Self, M>
type Result: MessageResponse<Self, M>
The return type of the handler, which must implement MessageResponse.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.