pub struct JitteredBackoff { /* private fields */ }Expand description
Jittered exponential backoff for retry delays
Implementations§
Source§impl JitteredBackoff
impl JitteredBackoff
Sourcepub fn with_max_backoff(max_backoff_ms: u64) -> Self
pub fn with_max_backoff(max_backoff_ms: u64) -> Self
With custom max backoff duration
Sourcepub fn backoff_duration(&self) -> Duration
pub fn backoff_duration(&self) -> Duration
Calculate backoff duration for current attempt (with jitter)
Sourcepub fn next_backoff(&mut self) -> Duration
pub fn next_backoff(&mut self) -> Duration
Advance to next attempt, return backoff duration
Trait Implementations§
Auto Trait Implementations§
impl Freeze for JitteredBackoff
impl RefUnwindSafe for JitteredBackoff
impl Send for JitteredBackoff
impl Sync for JitteredBackoff
impl Unpin for JitteredBackoff
impl UnsafeUnpin for JitteredBackoff
impl UnwindSafe for JitteredBackoff
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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