Skip to main content

Handler

Trait Handler 

Source
pub trait Handler<M>: Actor
where M: Message,
{ // Required method async fn handle( &self, myself: &Mailbox<Self>, message: M, state: &mut Self::State, ) -> Result<(), Self::Error>; }
Available on crate feature actor only.
Expand description

Handles messages of type M for an actor.

Required Methods§

Source

async fn handle( &self, myself: &Mailbox<Self>, message: M, state: &mut Self::State, ) -> Result<(), Self::Error>

Handles one message at a time.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§