pub enum LatencyProfile {
Constant(Duration),
LinearRamp {
start: Duration,
step: Duration,
},
StepSchedule(Vec<(usize, Duration)>),
}Expand description
Per-attempt latency profile.
All variants are deterministic.
Variants§
Constant(Duration)
Constant delay on every attempt.
LinearRamp
Linear ramp: start + (attempt - 1) * step.
Fields
StepSchedule(Vec<(usize, Duration)>)
Step function: piecewise-constant by boundaries. Each entry
(attempt_threshold, delay) means “use delay while attempt
is <= attempt_threshold”. The list MUST be sorted ascending
by attempt_threshold. Attempts beyond the last threshold use
the final entry’s delay.
Trait Implementations§
Source§impl Clone for LatencyProfile
impl Clone for LatencyProfile
Source§fn clone(&self) -> LatencyProfile
fn clone(&self) -> LatencyProfile
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for LatencyProfile
impl RefUnwindSafe for LatencyProfile
impl Send for LatencyProfile
impl Sync for LatencyProfile
impl Unpin for LatencyProfile
impl UnsafeUnpin for LatencyProfile
impl UnwindSafe for LatencyProfile
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