pub struct Addr<A>where
A: Actor,{ /* private fields */ }
Expand description
Address of the actor
Implementations
sourceimpl<A> Addr<A>where
A: Actor,
impl<A> Addr<A>where
A: Actor,
pub fn new(tx: AddressSender<A>) -> Addr<A>
sourcepub fn do_send<M>(&self, msg: M)where
M: Message + Send,
<M as Message>::Result: Send,
A: Handler<M>,
<A as Actor>::Context: ToEnvelope<A, M>,
pub fn do_send<M>(&self, msg: M)where
M: Message + Send,
<M as Message>::Result: Send,
A: Handler<M>,
<A as Actor>::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: 'static + Message + Send,
<M as Message>::Result: Send,
A: Handler<M>,
<A as Actor>::Context: ToEnvelope<A, M>,
pub fn try_send<M>(&self, msg: M) -> Result<(), SendError<M>>where
M: 'static + Message + Send,
<M as Message>::Result: Send,
A: Handler<M>,
<A as Actor>::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.
sourcepub fn send<M>(&self, msg: M) -> Request<A, M>where
M: Message + Send,
<M as Message>::Result: Send,
A: Handler<M>,
<A as Actor>::Context: ToEnvelope<A, M>,
pub fn send<M>(&self, msg: M) -> Request<A, M>where
M: Message + Send,
<M as Message>::Result: Send,
A: Handler<M>,
<A as Actor>::Context: ToEnvelope<A, M>,
Send asynchronous message and wait for response.
Communication channel to the actor is bounded. if returned Future
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<A, M, B> MessageResponse<A, M> for Addr<B>where
A: Actor,
M: Message<Result = Addr<B>>,
B: Actor<Context = Context<B>>,
impl<A, M, B> MessageResponse<A, M> for Addr<B>where
A: Actor,
M: Message<Result = Addr<B>>,
B: Actor<Context = Context<B>>,
sourceimpl<A> PartialEq<Addr<A>> for Addr<A>where
A: Actor,
impl<A> PartialEq<Addr<A>> for Addr<A>where
A: Actor,
impl<A> Eq for Addr<A>where
A: Actor,
Auto Trait Implementations
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
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.