pub struct Recipient<M>where
M: Message + Send,
<M as Message>::Result: Send,{ /* private fields */ }
Expand description
Recipient
type allows to send one specific message to an actor.
You can get recipient with Addr<_, _>::recipient()
method.
It is possible to use Clone::clone()
method to get cloned recipient.
Implementations
sourceimpl<M> Recipient<M>where
M: Message + Send,
<M as Message>::Result: Send,
impl<M> Recipient<M>where
M: Message + Send,
<M as Message>::Result: Send,
sourcepub fn do_send(&self, msg: M) -> Result<(), SendError<M>>
pub fn do_send(&self, msg: M) -> Result<(), SendError<M>>
Send message
Deliver message even if recipient’s mailbox is full
sourcepub fn try_send(&self, msg: M) -> Result<(), SendError<M>>
pub fn try_send(&self, msg: M) -> Result<(), SendError<M>>
Try send message
This method fails if actor’s mailbox is full or closed. This method register current task in receivers queue.
sourcepub fn send(&self, msg: M) -> RecipientRequest<M>
pub fn send(&self, msg: M) -> RecipientRequest<M>
Send message and asynchronously wait for response.
Communication channel to the actor is bounded. if returned Request
object get dropped, message cancels.
Trait Implementations
sourceimpl<A, M> Into<Recipient<M>> for Addr<A>where
A: Actor + Handler<M>,
M: 'static + Message + Send,
<M as Message>::Result: Send,
<A as Actor>::Context: ToEnvelope<A, M>,
impl<A, M> Into<Recipient<M>> for Addr<A>where
A: Actor + Handler<M>,
M: 'static + Message + Send,
<M as Message>::Result: Send,
<A as Actor>::Context: ToEnvelope<A, M>,
sourceimpl<M> PartialEq<Recipient<M>> for Recipient<M>where
M: Message + Send,
<M as Message>::Result: Send,
impl<M> PartialEq<Recipient<M>> for Recipient<M>where
M: Message + Send,
<M as Message>::Result: Send,
impl<M> Eq for Recipient<M>where
M: Message + Send,
<M as Message>::Result: Send,
Auto Trait Implementations
impl<M> !RefUnwindSafe for Recipient<M>
impl<M> Send for Recipient<M>
impl<M> !Sync for Recipient<M>
impl<M> Unpin for Recipient<M>
impl<M> !UnwindSafe for Recipient<M>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.