[][src]Struct riker::actor::Context

pub struct Context<Msg: Message> {
    pub myself: ActorRef<Msg>,
    pub system: ActorSystem,
    // some fields omitted
}

Provides context, including the actor system during actor execution.

Context is passed to an actor's functions, such as receive.

Operations performed are in most cases done so from the actor's perspective. For example, creating a child actor using ctx.actor_of will create the child under the current actor within the heirarchy. In a similar manner, persistence operations such as persist_event use the current actor's persistence configuration.

Since Context is specific to an actor and its functions it is not cloneable.

Fields

myself: ActorRef<Msg>system: ActorSystem

Methods

impl<Msg> Context<Msg> where
    Msg: Message
[src]

pub fn myself(&self) -> ActorRef<Msg>[src]

Returns the ActorRef of the current actor.

Trait Implementations

impl<Msg: Message> ActorRefFactory for Context<Msg>[src]

impl<Msg> ActorSelectionFactory for Context<Msg> where
    Msg: Message
[src]

impl<Msg> Run for Context<Msg> where
    Msg: Message
[src]

impl<Msg> Timer for Context<Msg> where
    Msg: Message
[src]

Auto Trait Implementations

impl<Msg> Sync for Context<Msg>

impl<Msg> Unpin for Context<Msg>

impl<Msg> Send for Context<Msg>

impl<Msg> !UnwindSafe for Context<Msg>

impl<Msg> !RefUnwindSafe for Context<Msg>

Blanket Implementations

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

impl<T> From<T> for T[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]