pub struct Addr<A: Actor> { /* private fields */ }
Expand description
The address of an 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)
pub fn do_send<M>(&self, msg: M)
Sends a message unconditionally, ignoring any potential errors.
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<M>(&self, msg: M) -> Result<(), SendError<M>>
pub fn try_send<M>(&self, msg: M) -> Result<(), SendError<M>>
Tries to send a message.
This method fails if actor’s mailbox is full or closed. This method registers the current task in the receiver’s queue.
Sourcepub fn send<M>(&self, msg: M) -> Request<A, M>
pub fn send<M>(&self, msg: M) -> Request<A, M>
Sends an asynchronous message and waits for a response.
The communication channel to the actor is bounded. If the returned request future gets dropped, the message is cancelled.
Trait Implementations§
Source§impl<A, M: Message + Send + 'static> From<Addr<A>> for WeakRecipient<M>
impl<A, M: Message + Send + 'static> From<Addr<A>> for WeakRecipient<M>
Source§fn from(addr: Addr<A>) -> WeakRecipient<M>
fn from(addr: Addr<A>) -> WeakRecipient<M>
Converts to this type from the input type.
Source§impl<A, M, B> MessageResponse<A, M> for Addr<B>
impl<A, M, B> MessageResponse<A, M> for Addr<B>
impl<A: Actor> Eq for Addr<A>
Auto Trait Implementations§
impl<A> Freeze for Addr<A>
impl<A> !RefUnwindSafe for Addr<A>
impl<A> Send for Addr<A>
impl<A> Sync for Addr<A>
impl<A> Unpin for Addr<A>
impl<A> !UnwindSafe for Addr<A>
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