Struct actix_web::actix::dev::ContextParts
source · pub struct ContextParts<A>where
A: Actor,
<A as Actor>::Context: AsyncContext<A>,{ /* private fields */ }
Implementations
sourceimpl<A> ContextParts<A>where
A: Actor,
<A as Actor>::Context: AsyncContext<A>,
impl<A> ContextParts<A>where
A: Actor,
<A as Actor>::Context: AsyncContext<A>,
sourcepub fn new(addr: AddressSenderProducer<A>) -> ContextParts<A>
pub fn new(addr: AddressSenderProducer<A>) -> ContextParts<A>
Create new ContextParts instance
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: 'static + ActorFuture<Item = (), Error = (), Actor = A>,
pub fn spawn<F>(&mut self, fut: F) -> SpawnHandlewhere
F: 'static + ActorFuture<Item = (), Error = (), Actor = A>,
Spawn new future to this context.
sourcepub fn wait<F>(&mut self, f: F)where
F: 'static + ActorFuture<Item = (), Error = (), Actor = A>,
pub fn wait<F>(&mut self, f: F)where
F: 'static + ActorFuture<Item = (), Error = (), Actor = A>,
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.
pub fn capacity(&mut self) -> usize
pub fn set_mailbox_capacity(&mut self, cap: usize)
pub fn address(&self) -> Addr<A>
pub fn started(&mut self) -> bool
Trait Implementations
Auto Trait Implementations
impl<A> !RefUnwindSafe for ContextParts<A>
impl<A> !Send for ContextParts<A>
impl<A> !Sync for ContextParts<A>
impl<A> Unpin for ContextParts<A>
impl<A> !UnwindSafe for ContextParts<A>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more