[][src]Struct act_zero::Addr

pub struct Addr<T: ?Sized + 'static> { /* fields omitted */ }

A strong reference to a spawned actor. Actors can be spawned using Addr::new.

Methods can be called on the actor after it has been spawned using the send!(...) and call!(...) macros.

Can be converted to the address of a trait-object using the upcast!(...) macro.

Implementations

impl<T: Actor> Addr<T>[src]

pub fn new<S: Spawn + ?Sized>(spawner: &S, value: T) -> Result<Self, SpawnError>[src]

Spawn an actor using the given spawner. If successful returns the address of the actor.

impl<T: ?Sized> Addr<T>[src]

pub fn detached() -> Self[src]

Create an address which does not refer to any actor.

impl<T: ?Sized + Send + 'static> Addr<T>[src]

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

Downgrade to a weak reference, which does not try to keep the actor alive.

pub fn downcast<U: Send + 'static>(self) -> Result<Addr<U>, Addr<T>>[src]

Attempt to downcast the address of a "trait-object actor" to a concrete type.

This function may succeed even when the cast would normally be unsuccessful if the address has become detached.

Trait Implementations

impl<T: Actor + ?Sized> AddrLike for Addr<T>[src]

type Actor = T

Type of the actor reference by this address.

impl<T: Actor + ?Sized> AsAddr for Addr<T>[src]

type Addr = Self

The inner address type

impl<T: ?Sized> Clone for Addr<T>[src]

impl<T: ?Sized> Debug for Addr<T>[src]

impl<T: ?Sized> Default for Addr<T>[src]

impl<T: ?Sized> Eq for Addr<T>[src]

impl<T: ?Sized> Hash for Addr<T>[src]

impl<T: ?Sized> Ord for Addr<T>[src]

impl<T: ?Sized, U: ?Sized> PartialEq<Addr<U>> for Addr<T>[src]

impl<T: ?Sized, U: ?Sized> PartialEq<Addr<U>> for WeakAddr<T>[src]

impl<T: ?Sized, U: ?Sized> PartialEq<WeakAddr<U>> for Addr<T>[src]

impl<T: ?Sized, U: ?Sized> PartialOrd<Addr<U>> for Addr<T>[src]

impl<T: ?Sized, U: ?Sized> PartialOrd<Addr<U>> for WeakAddr<T>[src]

impl<T: ?Sized, U: ?Sized> PartialOrd<WeakAddr<U>> for Addr<T>[src]

Auto Trait Implementations

impl<T> !RefUnwindSafe for Addr<T>[src]

impl<T: ?Sized> Send for Addr<T>[src]

impl<T: ?Sized> Sync for Addr<T>[src]

impl<T: ?Sized> Unpin for Addr<T>[src]

impl<T> !UnwindSafe for Addr<T>[src]

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> 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.