Struct actix::dev::ContextParts
source · pub struct ContextParts<A>where
A: Actor,
A::Context: AsyncContext<A>,{ /* private fields */ }
Implementations§
source§impl<A> ContextParts<A>where
A: Actor,
A::Context: AsyncContext<A>,
impl<A> ContextParts<A>where
A: Actor,
A::Context: AsyncContext<A>,
sourcepub fn stop(&mut self)
pub fn stop(&mut self)
Initiate stop process for actor execution
Actor could prevent stopping by returning false
from
Actor::stopping()
method.
sourcepub fn state(&self) -> ActorState
pub fn state(&self) -> ActorState
Actor execution state
sourcepub fn curr_handle(&self) -> SpawnHandle
pub fn curr_handle(&self) -> SpawnHandle
Handle of the running future
sourcepub fn spawn<F>(&mut self, fut: F) -> SpawnHandlewhere
F: ActorFuture<Item = (), Error = (), Actor = A> + 'static,
pub fn spawn<F>(&mut self, fut: F) -> SpawnHandlewhere
F: ActorFuture<Item = (), Error = (), Actor = A> + 'static,
Spawn new future to this context.
sourcepub fn wait<F>(&mut self, f: F)where
F: ActorFuture<Item = (), Error = (), Actor = A> + 'static,
pub fn wait<F>(&mut self, f: F)where
F: ActorFuture<Item = (), Error = (), Actor = A> + 'static,
Spawn new future to this context and wait future completion.
During wait period actor does not receive any messages.
sourcepub fn cancel_future(&mut self, handle: SpawnHandle) -> bool
pub fn cancel_future(&mut self, handle: SpawnHandle) -> bool
Cancel previously scheduled future.