[−][src]Struct riker::actor::Context
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]
Msg: Message,
Trait Implementations
impl<Msg: Message> ActorRefFactory for Context<Msg>
[src]
fn actor_of<A>(
&self,
props: BoxActorProd<A>,
name: &str
) -> Result<ActorRef<A::Msg>, CreateError> where
A: Actor,
[src]
&self,
props: BoxActorProd<A>,
name: &str
) -> Result<ActorRef<A::Msg>, CreateError> where
A: Actor,
fn stop(&self, actor: impl ActorReference)
[src]
impl<Msg> ActorSelectionFactory for Context<Msg> where
Msg: Message,
[src]
Msg: Message,
fn select(&self, path: &str) -> Result<ActorSelection, InvalidPath>
[src]
impl<Msg> Run for Context<Msg> where
Msg: Message,
[src]
Msg: Message,
fn run<Fut>(
&self,
future: Fut
) -> Result<RemoteHandle<<Fut as Future>::Output>, SpawnError> where
Fut: Future + Send + 'static,
<Fut as Future>::Output: Send,
[src]
&self,
future: Fut
) -> Result<RemoteHandle<<Fut as Future>::Output>, SpawnError> where
Fut: Future + Send + 'static,
<Fut as Future>::Output: Send,
impl<Msg> Timer for Context<Msg> where
Msg: Message,
[src]
Msg: Message,
fn schedule<T, M>(
&self,
initial_delay: Duration,
interval: Duration,
receiver: ActorRef<M>,
sender: Sender,
msg: T
) -> Uuid where
T: Message + Into<M>,
M: Message,
[src]
&self,
initial_delay: Duration,
interval: Duration,
receiver: ActorRef<M>,
sender: Sender,
msg: T
) -> Uuid where
T: Message + Into<M>,
M: Message,
fn schedule_once<T, M>(
&self,
delay: Duration,
receiver: ActorRef<M>,
sender: Sender,
msg: T
) -> Uuid where
T: Message + Into<M>,
M: Message,
[src]
&self,
delay: Duration,
receiver: ActorRef<M>,
sender: Sender,
msg: T
) -> Uuid where
T: Message + Into<M>,
M: Message,
fn schedule_at_time<T, M>(
&self,
time: DateTime<Utc>,
receiver: ActorRef<M>,
sender: Sender,
msg: T
) -> Uuid where
T: Message + Into<M>,
M: Message,
[src]
&self,
time: DateTime<Utc>,
receiver: ActorRef<M>,
sender: Sender,
msg: T
) -> Uuid where
T: Message + Into<M>,
M: Message,
fn cancel_schedule(&self, id: Uuid)
[src]
Auto Trait Implementations
impl<Msg> Send for Context<Msg>
impl<Msg> Unpin for Context<Msg>
impl<Msg> Sync for Context<Msg>
impl<Msg> !UnwindSafe for Context<Msg>
impl<Msg> !RefUnwindSafe for Context<Msg>
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,