pub struct SupervisionConfig {
pub max_attempts: Option<u32>,
pub initial_delay: Duration,
pub backoff_multiplier: f64,
pub max_delay: Duration,
}Expand description
Configuration for route supervision (automatic restart on crash).
Fields§
§max_attempts: Option<u32>Maximum number of restart attempts. None means infinite retries.
Default: Some(5).
initial_delay: DurationDelay before the first restart attempt. Default: 1 second.
backoff_multiplier: f64Multiplier applied to the delay after each failed attempt. Default: 2.0 (doubles each time).
max_delay: DurationMaximum delay cap between restart attempts. Default: 60 seconds.
Implementations§
Source§impl SupervisionConfig
impl SupervisionConfig
Sourcepub fn next_delay(&self, attempt: u32) -> Duration
pub fn next_delay(&self, attempt: u32) -> Duration
Compute the delay before attempt number attempt (1-indexed).
Formula: min(initial_delay * backoff_multiplier^(attempt-1), max_delay)
Trait Implementations§
Source§impl Clone for SupervisionConfig
impl Clone for SupervisionConfig
Source§fn clone(&self) -> SupervisionConfig
fn clone(&self) -> SupervisionConfig
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 moreSource§impl Debug for SupervisionConfig
impl Debug for SupervisionConfig
Source§impl Default for SupervisionConfig
impl Default for SupervisionConfig
Source§impl PartialEq for SupervisionConfig
impl PartialEq for SupervisionConfig
impl StructuralPartialEq for SupervisionConfig
Auto Trait Implementations§
impl Freeze for SupervisionConfig
impl RefUnwindSafe for SupervisionConfig
impl Send for SupervisionConfig
impl Sync for SupervisionConfig
impl Unpin for SupervisionConfig
impl UnsafeUnpin for SupervisionConfig
impl UnwindSafe for SupervisionConfig
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