#[non_exhaustive]pub enum Directive {
Resume,
Restart,
Stop,
Escalate,
Throttle {
factor: f32,
window: Duration,
},
Suspend {
mode: SuspendMode,
},
ResumeFrom(SuspendMode),
}Expand description
What the supervisor decides when a child fails — or, for the graded variants, how it should degrade a still-running child.
Resume/Restart/Stop/Escalate are the classic crash-recovery
directives. Throttle/Suspend/ResumeFrom are graded operating-mode
changes (FR-6): the supervisor pushes them into a running child via
Actor::on_directive without a
restart, so the child’s state is preserved. This lets a risk circuit
breaker reduce order rate/size or move to flat-only instead of bouncing the
actor.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Resume
Restart
Stop
Escalate
Throttle
Reduce the child’s effective rate/size by factor (e.g. 0.25 = quarter)
for at least window. Applied without restart.
Suspend
Move the child into a restricted operating mode without restart.
Fields
§
mode: SuspendModeResumeFrom(SuspendMode)
Step the child back up the ladder to a less-restrictive mode.
Trait Implementations§
impl Copy for Directive
impl Eq for Directive
impl StructuralPartialEq for Directive
Auto Trait Implementations§
impl Freeze for Directive
impl RefUnwindSafe for Directive
impl Send for Directive
impl Sync for Directive
impl Unpin for Directive
impl UnsafeUnpin for Directive
impl UnwindSafe for Directive
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.