Skip to main content

Receiver

Trait Receiver 

Source
pub trait Receiver<M: Message>: Send + Sync {
    // Required methods
    fn send(&self, msg: M) -> Result<(), ActorError>;
    fn request_raw(&self, msg: M) -> Result<Receiver<M::Result>, ActorError>;
}
Expand description

Object-safe trait for sending a single message type to an actor.

Implemented automatically by ActorRef<A> and Context<A> for any message type that A handles.

Required Methods§

Source

fn send(&self, msg: M) -> Result<(), ActorError>

Source

fn request_raw(&self, msg: M) -> Result<Receiver<M::Result>, ActorError>

Implementors§

Source§

impl<A, M> Receiver<M> for ActorRef<A>
where A: Actor + Handler<M>, M: Message,

Source§

impl<A, M> Receiver<M> for Context<A>
where A: Actor + Handler<M>, M: Message,