Struct actix::Addr [−][src]
The address of an actor.
Implementations
impl<A: Actor> Addr<A>
[src]
pub fn new(tx: AddressSender<A>) -> Addr<A>
[src]
pub fn connected(&self) -> bool
[src]
Returns whether the actor is still alive.
pub fn do_send<M>(&self, msg: M) where
M: Message + Send,
M::Result: Send,
A: Handler<M>,
A::Context: ToEnvelope<A, M>,
[src]
M: Message + Send,
M::Result: Send,
A: Handler<M>,
A::Context: ToEnvelope<A, 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.
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>,
[src]
M: Message + Send + 'static,
M::Result: Send,
A: Handler<M>,
A::Context: ToEnvelope<A, 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.
pub fn send<M>(&self, msg: M) -> Request<A, M> where
M: Message + Send + 'static,
M::Result: Send,
A: Handler<M>,
A::Context: ToEnvelope<A, M>,
[src]
M: Message + Send + 'static,
M::Result: Send,
A: Handler<M>,
A::Context: ToEnvelope<A, M>,
Sends an asynchronous message and waits for a response.
The communication channel to the actor is bounded. If the
returned Future
object gets dropped, the message is
cancelled.
pub fn recipient<M: 'static>(self) -> Recipient<M> where
A: Handler<M>,
A::Context: ToEnvelope<A, M>,
M: Message + Send,
M::Result: Send,
[src]
A: Handler<M>,
A::Context: ToEnvelope<A, M>,
M: Message + Send,
M::Result: Send,
Returns the Recipient
for a specific message type.
pub fn downgrade(&self) -> WeakAddr<A>
[src]
Returns a downgraded WeakAddr
.
Trait Implementations
impl<A: Actor> Clone for Addr<A>
[src]
impl<A: Debug + Actor> Debug for Addr<A>
[src]
impl<A: Actor> Eq for Addr<A>
[src]
impl<A: Actor, M: Message + Send + 'static> From<Addr<A>> for Recipient<M> where
A: Handler<M>,
M::Result: Send,
A::Context: ToEnvelope<A, M>,
[src]
A: Handler<M>,
M::Result: Send,
A::Context: ToEnvelope<A, M>,
impl<A: Actor, M: Message + Send + 'static> From<Addr<A>> for WeakRecipient<M> where
A: Handler<M>,
M::Result: Send,
A::Context: ToEnvelope<A, M>,
[src]
A: Handler<M>,
M::Result: Send,
A::Context: ToEnvelope<A, M>,
fn from(addr: Addr<A>) -> WeakRecipient<M>
[src]
impl<A: Actor> Hash for Addr<A>
[src]
fn hash<H: Hasher>(&self, state: &mut H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<A, M, B> MessageResponse<A, M> for Addr<B> where
A: Actor,
M: Message<Result = Self>,
B: Actor,
[src]
A: Actor,
M: Message<Result = Self>,
B: Actor,
fn handle(self, _: &mut A::Context, tx: Option<OneshotSender<Self>>)
[src]
impl<A: Actor> PartialEq<Addr<A>> for Addr<A>
[src]
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
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,