pub struct LadderBackoff {
pub steps: Vec<u64>,
pub jitter_ratio: f32,
}Expand description
The engine’s own answer: a ladder of delays, jittered, deferring to the provider when it names a delay itself.
Fields§
§steps: Vec<u64>One delay per retry, in milliseconds. Its length is the retry budget.
jitter_ratio: f32How far either side of a step the actual delay may land, as a fraction.
Implementations§
Source§impl LadderBackoff
impl LadderBackoff
Sourcepub const DEFAULT_STEPS: &'static [u64]
pub const DEFAULT_STEPS: &'static [u64]
Six steps covering roughly a minute — what both clients shipped with.
pub const DEFAULT_JITTER: f32 = 0.25
Sourcepub const MAX_SERVER_HINT: Duration
pub const MAX_SERVER_HINT: Duration
A provider asking for longer than this is not going to be waited for.
pub fn new() -> Self
Sourcepub fn from_millis(steps: Vec<u64>) -> Self
pub fn from_millis(steps: Vec<u64>) -> Self
A ladder of the caller’s own. Tests use it to collapse a minute of waiting into a few milliseconds.
Trait Implementations§
Source§impl BackoffPolicy for LadderBackoff
impl BackoffPolicy for LadderBackoff
fn after_failure(&self, attempt: &FailedAttempt) -> Backoff
Auto Trait Implementations§
impl Forget for LadderBackoff
impl Freeze for LadderBackoff
impl Move for LadderBackoff
impl RefUnwindSafe for LadderBackoff
impl Send for LadderBackoffwhere
RawVecInner: Send,
impl Sync for LadderBackoffwhere
RawVecInner: Sync,
impl Unpin for LadderBackoff
impl UnsafeUnpin for LadderBackoff
impl UnwindSafe for LadderBackoffwhere
RawVecInner: UnwindSafe,
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