Struct exponential_backoff::Backoff [−][src]
pub struct Backoff { /* fields omitted */ }Exponential backoff struct.
Methods
impl Backoff[src]
impl Backoffpub fn new(retries: u32) -> Self[src]
pub fn new(retries: u32) -> SelfCreate a new instance.
pub fn timeout_range(self, min: Duration, max: Duration) -> Self[src]
pub fn timeout_range(self, min: Duration, max: Duration) -> SelfSet the min and max durations.
pub fn jitter(self, jitter: f32) -> Self[src]
pub fn jitter(self, jitter: f32) -> SelfSet 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) -> SelfSet the growth factor for each iteration of the backoff.
pub fn iter(&self) -> Iter[src]
pub fn iter(&self) -> IterCreate an iterator.
Trait Implementations
impl Debug for Backoff[src]
impl Debug for Backofffn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl Clone for Backoff[src]
impl Clone for Backoff