pub struct ContextParts<A>{ /* private fields */ }
Implementations§
Source§impl<A> ContextParts<A>
impl<A> ContextParts<A>
Sourcepub fn new(addr: AddressSenderProducer<A>) -> Self
pub fn new(addr: AddressSenderProducer<A>) -> Self
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: ActorFuture<A, Output = ()> + 'static,
pub fn spawn<F>(&mut self, fut: F) -> SpawnHandlewhere
F: ActorFuture<A, Output = ()> + 'static,
Spawn new future to this context.
Sourcepub fn wait<F>(&mut self, f: F)where
F: ActorFuture<A, Output = ()> + 'static,
pub fn wait<F>(&mut self, f: F)where
F: ActorFuture<A, Output = ()> + '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.
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> Freeze for ContextParts<A>
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§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more