pub struct Addr<A: Actor> { /* private fields */ }
Expand description
Address of the actor
Implementations§
source§impl<A: Actor> Addr<A>
impl<A: Actor> Addr<A>
pub fn new(tx: AddressSender<A>) -> Addr<A>
sourcepub fn do_send<M>(&self, msg: M)where
M: Message + Send,
M::Result: Send,
A: Handler<M>,
A::Context: ToEnvelope<A, M>,
pub fn do_send<M>(&self, msg: M)where
M: Message + Send,
M::Result: Send,
A: Handler<M>,
A::Context: ToEnvelope<A, M>,
Send message unconditionally
This method ignores actor’s mailbox capacity, it silently fails if mailbox is closed.
sourcepub fn try_send<M>(&self, msg: M) -> Result<(), SendError<M>>where
M: Message + Send + 'static,
M::Result: Send,
A: Handler<M>,
A::Context: ToEnvelope<A, M>,
pub fn try_send<M>(&self, msg: M) -> Result<(), SendError<M>>where
M: Message + Send + 'static,
M::Result: Send,
A: Handler<M>,
A::Context: ToEnvelope<A, M>,
Try send message
This method fails if actor’s mailbox is full or closed. This method register current task in receivers queue.