crb_actor/message.rs
1use crate::actor::Actor;
2use anyhow::Error;
3use async_trait::async_trait;
4
5pub type Envelope<A> = Box<dyn MessageFor<A>>;
6
7#[async_trait]
8pub trait MessageFor<A: Actor + ?Sized>: Send + 'static {
9 async fn handle(self: Box<Self>, actor: &mut A, ctx: &mut A::Context) -> Result<(), Error>;
10}