Struct actix::dev::ContextImpl
[−]
[src]
pub struct ContextImpl<A, C = ()> where
A: Actor,
A::Context: AsyncContext<A> + AsyncContextApi<A>, { /* fields omitted */ }
Actor execution context impl
This is base Context implementation. It supports one extra cell
impl with type ContextCell<A>
(i.e. ActorFramedCell
)
Methods
impl<A, C> ContextImpl<A, C> where
A: Actor,
A::Context: AsyncContext<A> + AsyncContextApi<A>,
C: ContextCell<A>,
[src]
A: Actor,
A::Context: AsyncContext<A> + AsyncContextApi<A>,
C: ContextCell<A>,
fn new(act: Option<A>) -> ContextImpl<A, C>
[src]
fn with_cell(act: Option<A>, cell: C) -> ContextImpl<A, C>
[src]
fn with_receiver(
act: Option<A>,
rx: UnboundedReceiver<Envelope<A>>
) -> ContextImpl<A, C>
[src]
act: Option<A>,
rx: UnboundedReceiver<Envelope<A>>
) -> ContextImpl<A, C>
fn actor(&mut self) -> &mut A
[src]
Mutable reference to an actor.
It panics if actor is not set
fn cell(&mut self) -> &mut Option<C>
[src]
Mutable reference to cell
fn modify(&mut self)
[src]
Mark context as modified, this cause extra poll loop over all cells
fn wating(&self) -> bool
[src]
Is context waiting for future completion
fn stop(&mut self)
[src]
Initiate stop process for actor execution
Actor could prevent stopping by returning false
from Actor::stopping()
method.
fn terminate(&mut self)
[src]
Terminate actor execution
fn state(&self) -> ActorState
[src]
Actor execution state
fn spawn<F>(&mut self, fut: F) -> SpawnHandle where
F: ActorFuture<Item = (), Error = (), Actor = A> + 'static,
[src]
F: ActorFuture<Item = (), Error = (), Actor = A> + 'static,
Spawn new future to this context.
fn wait<F>(&mut self, fut: F) where
F: ActorFuture<Item = (), Error = (), Actor = A> + 'static,
[src]
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.
fn cancel_future(&mut self, handle: SpawnHandle) -> bool
[src]
Cancel previously scheduled future.
fn unsync_sender(&mut self) -> UnboundedSender<ContextProtocol<A>>
[src]
fn unsync_address(&mut self) -> Address<A>
[src]
fn sync_address(&mut self) -> SyncAddress<A>
[src]
fn subscriber<M>(&mut self) -> Box<Subscriber<M>> where
A: Handler<M>,
M: ResponseType + 'static,
[src]
A: Handler<M>,
M: ResponseType + 'static,
fn sync_subscriber<M>(&mut self) -> Box<Subscriber<M> + Send> where
A: Handler<M>,
M: ResponseType + Send + 'static,
M::Item: Send,
M::Error: Send,
[src]
A: Handler<M>,
M: ResponseType + Send + 'static,
M::Item: Send,
M::Error: Send,