[][src]Struct holly::actor::Addr

pub struct Addr<T, A = T> { /* fields omitted */ }

The address of an actor.

Allows sending messages to the actor.

Methods

impl<T, A: Into<T>> Addr<T, A>[src]

pub fn id(&self) -> Id[src]

Get address/actor ID.

pub fn send(self, msg: A) -> impl Future<Item = Self, Error = Error>[src]

Asynchronously send a message to the actor of this address.

Will fail if the recipient no longer exists. If the actor's mailbox is full, the future will wait until there is room.

pub fn send_now(&mut self, msg: A) -> Result<(), Error>[src]

Immediately send a message to the actor of this address.

Used outside of futures. Fails if the actor's mailbox is full or the recipient no longer exists.

pub fn cast<B: Into<T>>(&self) -> Addr<T, B>[src]

Create an Addr<T, B> from this Addr<T, A>.

This enables the creation of addresses which only accept a strict subset of messages the original address accepts.

Trait Implementations

impl<T, A> Clone for Addr<T, A>[src]

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

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl<T, A> Send for Addr<T, A> where
    A: Send,
    T: Send

impl<T, A> Sync for Addr<T, A> where
    A: Sync,
    T: Send

Blanket Implementations

impl<T> From for T[src]

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

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

type Owned = T

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.