Trait actix::prelude::ActorContext
[−]
[src]
pub trait ActorContext<A>: Sized where
A: Actor<Context = Self>, { fn stop(&mut self); fn terminate(&mut self); fn state(&self) -> ActorState; fn alive(&self) -> bool { ... } fn address<Address>(&mut self) -> Address
where
A: ActorAddress<A, Address>, { ... } }
Actor execution context
Each actor runs within specific execution context. Actor::Context
defines
context. Execution context defines type of execution, actor communition channels
(message handling).
Required Methods
fn stop(&mut self)
Gracefuly stop actor execution
fn terminate(&mut self)
Terminate actor execution
fn state(&self) -> ActorState
Actor execution state
Provided Methods
fn alive(&self) -> bool
Check if execution context is alive
fn address<Address>(&mut self) -> Address where
A: ActorAddress<A, Address>,
A: ActorAddress<A, Address>,
Get actor address
Implementors
impl<A> ActorContext<A> for Context<A> where
A: Actor<Context = Self>,impl<A> ActorContext<A> for FramedContext<A> where
A: Actor<Context = Self> + FramedActor,
A: StreamHandler<<<A as FramedActor>::Codec as Decoder>::Item, <<A as FramedActor>::Codec as Decoder>::Error>,
<<A as FramedActor>::Codec as Decoder>::Item: ResponseType,impl<A> ActorContext<A> for SyncContext<A> where
A: Actor<Context = Self>,