[][src]Struct xtra::Address

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

An Address is a reference to an actor through which Messages can be sent. It can be cloned, and when all Addresses are dropped, the actor will be stopped. Therefore, any existing Addresses will inhibit the dropping of an actor. If this is undesirable, then the WeakAddress struct should be used instead. This struct is created by calling the Actor::create or Actor::spawn methods.

Methods

impl<A: Actor + Send> Address<A>[src]

Important traits for WeakAddress<A>
pub fn downgrade(&self) -> WeakAddress<A>[src]

Create a weak address to the actor. Unlike with the strong variety of address (this kind), an actor will not be prevented from being dropped if only weak addresses exist.

Important traits for WeakAddress<A>
pub fn into_downgraded(self) -> WeakAddress<A>[src]

Converts this address into a weak address to the actor. Unlike with the strong variety of address (this kind), an actor will not be prevented from being dropped if only weak addresses exist.

pub fn channel<M: Message>(&self) -> MessageChannel<M> where
    A: Handler<M>, 
[src]

Gets a message channel to the actor. Like an address, a message channel allows messages to be sent to an actor. Unlike an address, rather than allowing you to send any kind of message to one kind of actor, a message channel allows you to send one kind of message to any kind of actor.

pub fn into_channel<M: Message>(self) -> MessageChannel<M> where
    A: Handler<M>, 
[src]

Converts this address into a message channel to the actor. Like an address, a message channel allows messages to be sent to an actor. Unlike an address, rather than allowing you to send any kind of message to one kind of actor, a message channel allows you to send one kind of message to any kind of actor.

Trait Implementations

impl<A: Actor> AddressExt<A> for Address<A>[src]

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

impl<A: Actor> Drop for Address<A>[src]

impl<M, A> Sink<M> for Address<A> where
    M: Message,
    A: Actor + Handler<M> + Send
[src]

type Error = Disconnected

The type of value produced by the sink when an error occurs.

Auto Trait Implementations

impl<A> !RefUnwindSafe for Address<A>

impl<A> Send for Address<A>

impl<A> Sync for Address<A>

impl<A> Unpin for Address<A>

impl<A> !UnwindSafe for Address<A>

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

impl<T, Item> SinkExt<Item> for T where
    T: Sink<Item> + ?Sized
[src]

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

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.