pub struct BackoffConfig {
pub initial_delay: Duration,
pub multiplier: f64,
pub max_delay: Duration,
}Expand description
Configuration for capped exponential backoff.
Defaults: 100ms initial, 2x multiplier, 30s cap. Multiplier MUST be >= 1.0; values below 1.0 silently produce zero-delay backoff (no throttling).
Fields§
§initial_delay: Duration§multiplier: f64§max_delay: DurationImplementations§
Source§impl BackoffConfig
impl BackoffConfig
pub fn delay_for_attempt(&self, attempt: u32) -> Duration
Trait Implementations§
Source§impl Clone for BackoffConfig
impl Clone for BackoffConfig
Source§fn clone(&self) -> BackoffConfig
fn clone(&self) -> BackoffConfig
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 BackoffConfig
impl Debug for BackoffConfig
Source§impl Default for BackoffConfig
impl Default for BackoffConfig
Source§impl PartialEq for BackoffConfig
impl PartialEq for BackoffConfig
Source§fn eq(&self, other: &BackoffConfig) -> bool
fn eq(&self, other: &BackoffConfig) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for BackoffConfig
Auto Trait Implementations§
impl Freeze for BackoffConfig
impl RefUnwindSafe for BackoffConfig
impl Send for BackoffConfig
impl Sync for BackoffConfig
impl Unpin for BackoffConfig
impl UnsafeUnpin for BackoffConfig
impl UnwindSafe for BackoffConfig
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