[][src]Struct xactor::Addr

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

The address of an actor.

When all references to Addr<A> are dropped, the actor ends. You can use Clone trait to create multiple copies of Addr<A>.

Implementations

impl<A> Addr<A>[src]

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

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

pub fn actor_id(&self) -> ActorId[src]

Returns the id of the actor.

pub fn stop(&mut self, err: Option<Error>) -> Result<()>[src]

Stop the actor.

pub async fn call<T: Message>(&self, msg: T) -> Result<T::Result> where
    A: Handler<T>, 
[src]

Send a message msg to the actor and wait for the return value.

pub fn send<T: Message<Result = ()>>(&self, msg: T) -> Result<()> where
    A: Handler<T>, 
[src]

Send a message msg to the actor without waiting for the return value.

pub fn caller<T: Message>(&self) -> Caller<T> where
    A: Handler<T>, 
[src]

Create a Caller<T> for a specific message type

pub fn sender<T: Message<Result = ()>>(&self) -> Sender<T> where
    A: Handler<T>, 
[src]

Create a Sender<T> for a specific message type

pub async fn wait_for_stop(self)[src]

Wait for an actor to finish, and if the actor has finished, the function returns immediately.

impl<T: Message<Result = ()> + Clone> Addr<Broker<T>>[src]

pub fn publish(&mut self, msg: T) -> Result<()>[src]

Publishes a message of the specified type.

Trait Implementations

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

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

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

Auto Trait Implementations

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

impl<A> Send for Addr<A>[src]

impl<A> Sync for Addr<A>[src]

impl<A> Unpin for Addr<A>[src]

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