pub struct LinearBackoff { /* private fields */ }
Expand description
Linear backoff strategy
Increases delay linearly by adding a fixed increment with each attempt.
Implementations§
Source§impl LinearBackoff
impl LinearBackoff
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new linear backoff with default settings
Defaults:
- Initial delay: 100ms
- Increment: 100ms (adds 100ms per attempt)
- Max delay: 10000ms (10 seconds)
Sourcepub fn with_initial_delay(self, delay_ms: u64) -> Self
pub fn with_initial_delay(self, delay_ms: u64) -> Self
Set the initial delay in milliseconds
Sourcepub fn with_increment(self, increment_ms: u64) -> Self
pub fn with_increment(self, increment_ms: u64) -> Self
Set the increment in milliseconds
Sourcepub fn with_max_delay(self, delay_ms: u64) -> Self
pub fn with_max_delay(self, delay_ms: u64) -> Self
Set the maximum delay in milliseconds
Trait Implementations§
Source§impl Backoff for LinearBackoff
impl Backoff for LinearBackoff
Source§impl Clone for LinearBackoff
impl Clone for LinearBackoff
Source§fn clone(&self) -> LinearBackoff
fn clone(&self) -> LinearBackoff
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for LinearBackoff
impl RefUnwindSafe for LinearBackoff
impl Send for LinearBackoff
impl Sync for LinearBackoff
impl Unpin for LinearBackoff
impl UnwindSafe for LinearBackoff
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