pub enum Strategy {
    Exponential {
        init_min: Milliseconds<u64>,
        init_max: Milliseconds<u64>,
    },
    Delay {
        min: Milliseconds<u64>,
        max: Milliseconds<u64>,
    },
}
Expand description

Strategy to employ when retrying

Variants

Exponential

Fields

init_min: Milliseconds<u64>

Minimum (inclusive) delay for second attempt

init_max: Milliseconds<u64>

Maximum (inclusive) delay for second attempt

Generate a random delay between min and max, and wait until this delay has passed between attempts.

After each failed attempt, double the delay before retrying again.

Delay

Fields

min: Milliseconds<u64>

Minimum (inclusive) delay for attempts

max: Milliseconds<u64>

Maximum (inclusive) delay for attempts

Generate a random delay between min and max, and wait until this delay has passed between attempts.

Implementations

Are min & max delays the same? if so, we should probably skip the random number generation.

Get the min & max durations as an inclusive range

Get the amount of time this strategy will take if all attempts fail

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.