[][src]Struct xtra::WeakAddress

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

A WeakAddress is a reference to an actor through which Messages can be sent. It can be cloned. Unlike Address, a WeakAddress will not inhibit the dropping of an actor. It is created by the Address::downgrade or Address::into_downgraded methods.

Implementations

impl<A: Actor> WeakAddress<A>[src]

pub fn channel<M: Message>(&self) -> WeakMessageChannel<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. This method involves a clone of the address, and as such is slightly more expensive than WeakAddress::into_channel.

pub fn into_channel<M: Message>(self) -> WeakMessageChannel<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. This method does not clone the address, and as such is slightly less expensive than WeakAddress::channel.

Trait Implementations

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

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

impl<A, M> Into<WeakMessageChannel<M>> for WeakAddress<A> where
    A: Handler<M>,
    M: Message
[src]

impl<M, A> Sink<M> for WeakAddress<A> where
    M: Message,
    A: Handler<M>, 
[src]

type Error = Disconnected

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

Auto Trait Implementations

impl<A> !RefUnwindSafe for WeakAddress<A>

impl<A> Send for WeakAddress<A>

impl<A> Sync for WeakAddress<A>

impl<A> Unpin for WeakAddress<A>

impl<A> !UnwindSafe for WeakAddress<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.