pub struct SupervisorActor { /* private fields */ }Expand description
Example supervisor actor that manages child actors
Implementations§
Trait Implementations§
Source§impl ActorBehavior for SupervisorActor
impl ActorBehavior for SupervisorActor
Source§fn receive(
&mut self,
message: Message,
ctx: &mut ActorContext,
) -> Result<Option<Message>>
fn receive( &mut self, message: Message, ctx: &mut ActorContext, ) -> Result<Option<Message>>
Handle incoming messages Read more
Source§fn supervisor_strategy(
&mut self,
child: ActorId,
_reason: &str,
) -> SupervisorDirective
fn supervisor_strategy( &mut self, child: ActorId, _reason: &str, ) -> SupervisorDirective
Handle actor supervision - called when a child actor fails
Source§fn pre_start(&mut self, _ctx: &mut ActorContext) -> Result<()>
fn pre_start(&mut self, _ctx: &mut ActorContext) -> Result<()>
Called when the actor starts Read more
Source§fn post_stop(&mut self, _ctx: &mut ActorContext) -> Result<()>
fn post_stop(&mut self, _ctx: &mut ActorContext) -> Result<()>
Called when the actor stops Read more
Source§fn pre_restart(&mut self, _ctx: &mut ActorContext, _reason: &str) -> Result<()>
fn pre_restart(&mut self, _ctx: &mut ActorContext, _reason: &str) -> Result<()>
Called when the actor is about to restart Read more
Source§fn post_restart(&mut self, _ctx: &mut ActorContext, _reason: &str) -> Result<()>
fn post_restart(&mut self, _ctx: &mut ActorContext, _reason: &str) -> Result<()>
Called after the actor has restarted Read more
Auto Trait Implementations§
impl Freeze for SupervisorActor
impl RefUnwindSafe for SupervisorActor
impl Send for SupervisorActor
impl Sync for SupervisorActor
impl Unpin for SupervisorActor
impl UnwindSafe for SupervisorActor
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more