pub struct SupervisorStrategy {
pub kind: StrategyKind,
pub max_retries: Option<u32>,
pub within: Option<Duration>,
pub decider: Decider,
}Expand description
Strategy applied to children of a supervising actor. Splits into
OneForOne (each child handled independently) and AllForOne
(one child’s failure restarts all siblings).
Fields§
§kind: StrategyKind§max_retries: Option<u32>§within: Option<Duration>§decider: DeciderImplementations§
Source§impl SupervisorStrategy
impl SupervisorStrategy
pub fn decide(&self, err: &str) -> Directive
Sourcepub fn on_max_retries(&self) -> Directive
pub fn on_max_retries(&self) -> Directive
Directive applied when Self::max_retries within
Self::within is exceeded.
Defaults to Directive::Escalate — matching Akka’s behaviour:
the parent supervisor decides the next step, and at the user-guardian
root that is equivalent to stopping the cell. Override via a future
builder method when per-strategy on-overflow behaviour is needed.
Trait Implementations§
Source§impl Clone for SupervisorStrategy
impl Clone for SupervisorStrategy
Source§fn clone(&self) -> SupervisorStrategy
fn clone(&self) -> SupervisorStrategy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SupervisorStrategy
impl Debug for SupervisorStrategy
Source§impl Default for SupervisorStrategy
impl Default for SupervisorStrategy
Source§impl From<AllForOneStrategy> for SupervisorStrategy
impl From<AllForOneStrategy> for SupervisorStrategy
Source§fn from(o: AllForOneStrategy) -> Self
fn from(o: AllForOneStrategy) -> Self
Converts to this type from the input type.
Source§impl From<OneForOneStrategy> for SupervisorStrategy
impl From<OneForOneStrategy> for SupervisorStrategy
Source§fn from(o: OneForOneStrategy) -> Self
fn from(o: OneForOneStrategy) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for SupervisorStrategy
impl !RefUnwindSafe for SupervisorStrategy
impl Send for SupervisorStrategy
impl Sync for SupervisorStrategy
impl Unpin for SupervisorStrategy
impl UnsafeUnpin for SupervisorStrategy
impl !UnwindSafe for SupervisorStrategy
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