Struct exponential_backoff::Backoff [−][src]
pub struct Backoff { /* fields omitted */ }
Exponential backoff.
Methods
impl Backoff
[src]
impl Backoff
pub fn new(retries: u32) -> Self
[src]
pub fn new(retries: u32) -> Self
Create a new instance.
pub fn timeout_range(self, min: Duration, max: Duration) -> Self
[src]
pub fn timeout_range(self, min: Duration, max: Duration) -> Self
Set the min and max durations.
pub fn jitter(self, jitter: f32) -> Self
[src]
pub fn jitter(self, jitter: f32) -> Self
Set the amount of jitter per backoff.
Panics
This method panics if a number smaller than 0
or larger than 1
is
provided.
pub fn factor(self, factor: u32) -> Self
[src]
pub fn factor(self, factor: u32) -> Self
Set the growth factor for each iteration of the backoff.
ⓘImportant traits for Iter<'b>pub fn iter(&self) -> Iter
[src]
ⓘImportant traits for Iter<'b>
pub fn iter(&self) -> Iter
Create an iterator.
Trait Implementations
impl Debug for Backoff
[src]
impl Debug for Backoff
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for Backoff
[src]
impl Clone for Backoff
fn clone(&self) -> Backoff
[src]
fn clone(&self) -> Backoff
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl<'b> IntoIterator for &'b Backoff
[src]
impl<'b> IntoIterator for &'b Backoff