pub enum Backoff {
Fixed(Duration),
Exponential {
initial: Duration,
factor: f64,
max: Duration,
jitter: bool,
},
}Expand description
Backoff strategy: how long to wait after each failure before the next attempt.
Variants§
Fixed(Duration)
Fixed interval.
Exponential
Exponential backoff: initial * factor^attempt, capped at max;
when jitter is on, draw full jitter in [0, computed value)
(thundering-herd protection — requests failing at the same time do
not all retry at the same moment).
Trait Implementations§
impl StructuralPartialEq for Backoff
Auto Trait Implementations§
impl Freeze for Backoff
impl RefUnwindSafe for Backoff
impl Send for Backoff
impl Sync for Backoff
impl Unpin for Backoff
impl UnsafeUnpin for Backoff
impl UnwindSafe for Backoff
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