[][src]Struct riker::actor::ActorRef

pub struct ActorRef<Msg: Message> {
    pub cell: ExtendedCell<Msg>,
}

An actor reference exposes methods to interact with its underlying actor.

All actor references are products of system.actor_of or context.actor_of. When an actor is created using actor_of an ActorRef is returned.

Actor references are lightweight and can be cloned without concern for memory use.

In the event that the underlying actor is terminated messages sent to the actor will be routed to dead letters.

If an actor is restarted all existing references continue to be valid.

Fields

cell: ExtendedCell<Msg>

Methods

impl<Msg: Message> ActorRef<Msg>[src]

pub fn send_msg(&self, msg: Msg, sender: impl Into<Option<BasicActorRef>>)[src]

Trait Implementations

impl<Msg: Message> ActorReference for ActorRef<Msg>[src]

fn name(&self) -> &str[src]

Actor name.

Unique among siblings.

fn path(&self) -> &ActorPath[src]

Actor path.

e.g. /user/actor_a/actor_b

fn parent(&self) -> BasicActorRef[src]

Parent reference.

fn children<'a>(&'a self) -> Box<dyn Iterator<Item = BasicActorRef> + 'a>[src]

Iterator over children references.

impl<'_, Msg: Message> ActorReference for &'_ ActorRef<Msg>[src]

fn name(&self) -> &str[src]

Actor name.

Unique among siblings.

fn path(&self) -> &ActorPath[src]

Actor path.

e.g. /user/actor_a/actor_b

fn parent(&self) -> BasicActorRef[src]

Parent reference.

fn children<'a>(&'a self) -> Box<dyn Iterator<Item = BasicActorRef> + 'a>[src]

Iterator over children references.

impl<T, M> Tell<T> for ActorRef<M> where
    T: Message + Into<M>,
    M: Message
[src]

impl<Msg: Clone + Message> Clone for ActorRef<Msg>[src]

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

Performs copy-assignment from source. Read more

impl<Msg: Message> PartialEq<ActorRef<Msg>> for ActorRef<Msg>[src]

#[must_use] fn ne(&self, other: &Rhs) -> bool1.0.0[src]

This method tests for !=.

impl<Msg> From<ActorRef<Msg>> for BasicActorRef where
    Msg: Message
[src]

impl<Msg> From<ActorRef<Msg>> for Option<BasicActorRef> where
    Msg: Message
[src]

impl<Msg: Message> Debug for ActorRef<Msg>[src]

impl<Msg: Message> Display for ActorRef<Msg>[src]

Auto Trait Implementations

impl<Msg> Sync for ActorRef<Msg>

impl<Msg> Unpin for ActorRef<Msg>

impl<Msg> Send for ActorRef<Msg>

impl<Msg> !UnwindSafe for ActorRef<Msg>

impl<Msg> !RefUnwindSafe for ActorRef<Msg>

Blanket Implementations

impl<T> Message for T where
    T: 'static + Send + Clone + Debug
[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> From<T> for T[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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.

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

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

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