[][src]Struct actix::Addr

pub struct Addr<A: Actor> { /* fields omitted */ }

The address of an actor.

Methods

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]

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]

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,
    M::Result: Send,
    A: Handler<M>,
    A::Context: ToEnvelope<A, M>, 
[src]

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]

Returns the Recipient for a specific message type.

pub fn downgrade(&self) -> WeakAddr<A>[src]

Returns a downgraded WeakAddr.

Trait Implementations

impl<A, M, B> MessageResponse<A, M> for Addr<B> where
    A: Actor,
    M: Message<Result = Self>,
    B: Actor<Context = Context<B>>, 
[src]

impl<A: Actor> Eq for Addr<A>[src]

impl<A: Actor> PartialEq<Addr<A>> for Addr<A>[src]

#[must_use]
default fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests for !=.

impl<A: Actor> Clone for Addr<A>[src]

default fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<A: Actor, M: Message + Send + 'static> Into<Recipient<M>> for Addr<A> where
    A: Handler<M>,
    M::Result: Send,
    A::Context: ToEnvelope<A, M>, 
[src]

impl<A: Debug + Actor> Debug for Addr<A>[src]

impl<A: Actor> Hash for Addr<A>[src]

default fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

Auto Trait Implementations

impl<A> Send for Addr<A>

impl<A> Sync for Addr<A>

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Erased for T