pub struct Backoff { /* private fields */ }Implementations§
Source§impl Backoff
impl Backoff
Sourcepub fn explicit(steps: Vec<Duration>) -> Self
pub fn explicit(steps: Vec<Duration>) -> Self
The n-th retry waits steps[min(n, len) - 1]; with no steps every
retry waits the minimum delay.
Sourcepub fn exponential(base: Duration, max: Duration) -> Self
pub fn exponential(base: Duration, max: Duration) -> Self
The n-th retry waits base * 2^(n - 1), capped at max.
Trait Implementations§
impl Eq for Backoff
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