pub struct ExponentialBackoff { /* private fields */ }Expand description
Allocation-free exponential backoff reset by provider progress.
Implementations§
Source§impl ExponentialBackoff
impl ExponentialBackoff
Sourcepub const fn new(
initial: MonotonicDuration,
maximum: MonotonicDuration,
multiplier: u8,
) -> Result<Self, ExponentialBackoffError>
pub const fn new( initial: MonotonicDuration, maximum: MonotonicDuration, multiplier: u8, ) -> Result<Self, ExponentialBackoffError>
Creates bounded deterministic backoff.
Sourcepub const fn next_delay(self) -> MonotonicDuration
pub const fn next_delay(self) -> MonotonicDuration
Returns the next delay before progress policy is applied.
Trait Implementations§
Source§impl Clone for ExponentialBackoff
impl Clone for ExponentialBackoff
Source§fn clone(&self) -> ExponentialBackoff
fn clone(&self) -> ExponentialBackoff
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 ExponentialBackoff
Source§impl Debug for ExponentialBackoff
impl Debug for ExponentialBackoff
impl Eq for ExponentialBackoff
Source§impl PartialEq for ExponentialBackoff
impl PartialEq for ExponentialBackoff
Source§impl PollBackoff for ExponentialBackoff
impl PollBackoff for ExponentialBackoff
Source§type Error = Infallible
type Error = Infallible
Policy-specific failure. Driver diagnostics always redact this value.
Source§fn delay(
&mut self,
context: PollContext,
) -> Result<MonotonicDuration, Self::Error>
fn delay( &mut self, context: PollContext, ) -> Result<MonotonicDuration, Self::Error>
Chooses one requested delay from validated nonsensitive context.
impl StructuralPartialEq for ExponentialBackoff
Auto Trait Implementations§
impl Freeze for ExponentialBackoff
impl RefUnwindSafe for ExponentialBackoff
impl Send for ExponentialBackoff
impl Sync for ExponentialBackoff
impl Unpin for ExponentialBackoff
impl UnsafeUnpin for ExponentialBackoff
impl UnwindSafe for ExponentialBackoff
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