pub enum TerminationReason {
Stopped,
Panicked(String),
RestartLimitExceeded,
}Expand description
Why an actor terminated — used by watches and restart policies.
§Examples
ⓘ
impl Actor for Supervisor {
type State = SupervisorState;
fn on_actor_terminated(&mut self, state: &mut SupervisorState, event: &ActorTerminated) {
match &event.reason {
TerminationReason::Stopped => println!("{} stopped cleanly", event.label),
TerminationReason::Panicked(msg) => println!("{} panicked: {msg}", event.label),
TerminationReason::RestartLimitExceeded => println!("{} gave up", event.label),
}
}
}Variants§
Stopped
Clean shutdown (receptionist.stop() or channel close)
Panicked(String)
catch_unwind caught a panic
RestartLimitExceeded
Restart limit exceeded within the configured time window
Trait Implementations§
Source§impl Clone for TerminationReason
impl Clone for TerminationReason
Source§fn clone(&self) -> TerminationReason
fn clone(&self) -> TerminationReason
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TerminationReason
impl RefUnwindSafe for TerminationReason
impl Send for TerminationReason
impl Sync for TerminationReason
impl Unpin for TerminationReason
impl UnsafeUnpin for TerminationReason
impl UnwindSafe for TerminationReason
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