pub struct Context<A>where
A: Actor<Context = Self>,{ /* private fields */ }Expand description
The default implementation of an actor context.
Implementations§
Trait Implementations§
Source§impl<A> ActorContext<A> for Context<A>where
A: Actor<Context = Self>,
impl<A> ActorContext<A> for Context<A>where
A: Actor<Context = Self>,
Source§fn take_mailbox(&mut self) -> Option<Mailbox<A>>
fn take_mailbox(&mut self) -> Option<Mailbox<A>>
Returns the mailbox of the actor.
Source§fn state(&self) -> ActorState
fn state(&self) -> ActorState
Returns the state of the actor.
Source§fn set_state(&mut self, state: ActorState)
fn set_state(&mut self, state: ActorState)
Sets the state of the actor.
Source§fn supervisor(&self) -> Option<&Recipient<SupervisionEvent<A>>>
fn supervisor(&self) -> Option<&Recipient<SupervisionEvent<A>>>
Returns the address of the supervisor.
Source§fn set_supervisor(&mut self, supervisor: Option<Recipient<SupervisionEvent<A>>>)
fn set_supervisor(&mut self, supervisor: Option<Recipient<SupervisionEvent<A>>>)
Sets a supervisor.
Source§async fn processing(
&mut self,
actor: &mut A,
mailbox: Mailbox<A>,
) -> Result<(), A::Error>
async fn processing( &mut self, actor: &mut A, mailbox: Mailbox<A>, ) -> Result<(), A::Error>
Runs the main processing loop of the actor. Read more
Source§fn drain_mailbox(&mut self)
fn drain_mailbox(&mut self)
Drains the mailbox of the actor. Read more
Source§fn stop_with_error(&mut self, error: A::Error)
fn stop_with_error(&mut self, error: A::Error)
Stops the actor and save the error for reporting. Read more
Source§fn terminate_with_error(&mut self, error: A::Error)
fn terminate_with_error(&mut self, error: A::Error)
Terminates the actor and save the error for reporting. Read more
Source§fn notify_supervisor(
&mut self,
event: SupervisionEvent<A>,
) -> impl Future<Output = ()> + Send
fn notify_supervisor( &mut self, event: SupervisionEvent<A>, ) -> impl Future<Output = ()> + Send
Notifies the supervisor for an event. Read more
Source§fn try_notify_supervisor(&mut self, event: SupervisionEvent<A>)
fn try_notify_supervisor(&mut self, event: SupervisionEvent<A>)
Notifies the supervisor for an event. Read more
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