pub struct BackoffOptions {
pub max_attempts: u32,
pub base_delay: Duration,
pub max_delay: Option<Duration>,
}Expand description
Knobs for with_backoff. Defaults tuned for the worker hot loop:
5 attempts over ~15 s of exponential wait (0.5 → 1 → 2 → 4 → 8 s) is
usually enough for transient hiccups without wedging an event-handler
on a genuine outage.
Fields§
§max_attempts: u32§base_delay: Duration§max_delay: Option<Duration>Upper bound on a single sleep. None = no cap. Cap applies to the
exponential branch only — retry_after from a server is honored
verbatim (the server is authoritative on its own quota).
Trait Implementations§
Source§impl Clone for BackoffOptions
impl Clone for BackoffOptions
Source§fn clone(&self) -> BackoffOptions
fn clone(&self) -> BackoffOptions
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 moreimpl Copy for BackoffOptions
Source§impl Debug for BackoffOptions
impl Debug for BackoffOptions
Auto Trait Implementations§
impl Freeze for BackoffOptions
impl RefUnwindSafe for BackoffOptions
impl Send for BackoffOptions
impl Sync for BackoffOptions
impl Unpin for BackoffOptions
impl UnsafeUnpin for BackoffOptions
impl UnwindSafe for BackoffOptions
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more