pub struct Context<A> { /* private fields */ }Expand description
A cloneable context for the actor.
Currently this fuctions as a means by which to alter the state of the Executor, it is
cloneable and can thus be sent to other threads, runtimes or even other actors to trigger a
shutdown.
Implementations§
Source§impl<A> Context<A>
impl<A> Context<A>
Sourcepub fn shutdown(&self)
pub fn shutdown(&self)
Triggers the end of the executor.
Once triggered, no new messages will be processed and the actor will exit after resolving
Actor::stopping
Sourcepub fn address(&self) -> &WeakAddress<A>
pub fn address(&self) -> &WeakAddress<A>
Retrieve the address for the executor’s actor
This is useful when an actor wants to emit messages to itself.
Trait Implementations§
Auto Trait Implementations§
impl<A> Freeze for Context<A>
impl<A> RefUnwindSafe for Context<A>
impl<A> Send for Context<A>
impl<A> Sync for Context<A>
impl<A> Unpin for Context<A>
impl<A> UnsafeUnpin for Context<A>
impl<A> UnwindSafe for Context<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