pub struct Recipient<M>{ /* private fields */ }
Expand description
The Recipient
type allows to send one specific message to an actor.
You can get a recipient using the Addr::recipient()
method. It is possible
to use the Clone::clone()
method to get a cloned recipient.
Implementations§
source§impl<M> Recipient<M>
impl<M> Recipient<M>
sourcepub fn do_send(&self, msg: M)
pub fn do_send(&self, msg: M)
Sends a message.
The message is always queued, even if the mailbox for the receiver is full. If the mailbox is closed, the message is silently dropped.
sourcepub fn try_send(&self, msg: M) -> Result<(), SendError<M>>
pub fn try_send(&self, msg: M) -> Result<(), SendError<M>>
Attempts to send a message.
This method fails if the actor’s mailbox is full or closed. This method registers the current task in the receivers queue.
sourcepub fn send(&self, msg: M) -> RecipientRequest<M>
pub fn send(&self, msg: M) -> RecipientRequest<M>
Sends a message and asynchronously wait for a response.
The communication channel to the actor is bounded. If the returned RecipientRequest
object
gets dropped, the message is cancelled.
pub fn connected(&self) -> bool
sourcepub fn downgrade(&self) -> WeakRecipient<M>
pub fn downgrade(&self) -> WeakRecipient<M>
Returns a downgraded WeakRecipient
Trait Implementations§
source§impl<M> From<Recipient<M>> for WeakRecipient<M>
impl<M> From<Recipient<M>> for WeakRecipient<M>
source§impl<M> PartialEq for Recipient<M>
impl<M> PartialEq for Recipient<M>
impl<M> Eq for Recipient<M>
Auto Trait Implementations§
impl<M> Freeze for Recipient<M>
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§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more