Struct ExponentialBackoffMaker

pub struct ExponentialBackoffMaker<R = HasherRng> { /* private fields */ }

A maker type for ExponentialBackoff.

Implementations

impl<R> ExponentialBackoffMaker<R> where R: Rng,

fn new(min: Duration, max: Duration, jitter: f64, rng: R) -> Result<Self, InvalidBackoff>

Create a new ExponentialBackoff.

Error

Returns a config validation error if:

  • min > max
  • max == 0
  • jitter < 0.0
  • jitter > 100.0
  • jitter is NaN

Trait Implementations

impl Default for ExponentialBackoffMaker

fn default() -> Self

impl<R> MakeBackoff for ExponentialBackoffMaker<R> where R: Rng + Clone,

type Backoff = ExponentialBackoff<R>;
fn make_backoff(&mut self) -> Self::Backoff

impl<R: Clone> Clone for ExponentialBackoffMaker<R>

fn clone(&self) -> Self

impl<R: Debug> Debug for ExponentialBackoffMaker<R>

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Auto Trait Implementations

impl<R> Freeze for ExponentialBackoffMaker<R> where R: Freeze,

impl<R> RefUnwindSafe for ExponentialBackoffMaker<R> where R: RefUnwindSafe,

impl<R> Send for ExponentialBackoffMaker<R> where R: Send,

impl<R> Sync for ExponentialBackoffMaker<R> where R: Sync,

impl<R> Unpin for ExponentialBackoffMaker<R> where R: Unpin,

impl<R> UnsafeUnpin for ExponentialBackoffMaker<R> where R: UnsafeUnpin,

impl<R> UnwindSafe for ExponentialBackoffMaker<R> where R: UnwindSafe,

Blanket Implementations

impl<T> Any for ExponentialBackoffMaker<R> where T: 'static + ?Sized,

impl<T> Borrow<T> for ExponentialBackoffMaker<R> where T: ?Sized,

impl<T> BorrowMut<T> for ExponentialBackoffMaker<R> where T: ?Sized,

impl<T> CloneToUninit for ExponentialBackoffMaker<R> where T: Clone,

impl<T> From<T> for ExponentialBackoffMaker<R>

impl<T> Instrument for ExponentialBackoffMaker<R>

impl<T> ToOwned for ExponentialBackoffMaker<R> where T: Clone,

impl<T> WithSubscriber for ExponentialBackoffMaker<R>

impl<T, U> Into<U> for ExponentialBackoffMaker<R> where U: From<T>,

impl<T, U> TryFrom<U> for ExponentialBackoffMaker<R> where U: Into<T>,

impl<T, U> TryInto<U> for ExponentialBackoffMaker<R> where U: TryFrom<T>,