#[non_exhaustive]pub enum JitterPolicy {
Full,
None,
Equal,
Decorrelated,
}Expand description
Controls how random jitter is applied to backoff delays.
Jitter distributes retries over time, preventing synchronized “retry storms” when many tasks fail simultaneously.
| Variant | Delay range | Collision resistance |
|---|---|---|
None | exactly base | none (deterministic) |
Full | uniform [0, base] | highest |
Equal | base/2 ± rand(base/2) | moderate |
Decorrelated | min(max, rand(base * 3)) | high |
The exact math is implemented in the backoff subsystem; this enum only selects the strategy.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Full
Full jitter: delay is uniformly sampled from [0, base].
None
No randomness applied. Backoff durations remain fixed.
Equal
Equal jitter: delay is sampled around the midpoint (base / 2), providing a balance between stability and randomness.
Decorrelated jitter: delay is sampled from min(max, rand(base * 3)).
Trait Implementations§
Source§impl Clone for JitterPolicy
impl Clone for JitterPolicy
Source§fn clone(&self) -> JitterPolicy
fn clone(&self) -> JitterPolicy
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for JitterPolicy
impl Debug for JitterPolicy
Source§impl Default for JitterPolicy
impl Default for JitterPolicy
Source§fn default() -> JitterPolicy
fn default() -> JitterPolicy
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for JitterPolicy
impl<'de> Deserialize<'de> for JitterPolicy
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl FromStr for JitterPolicy
impl FromStr for JitterPolicy
Source§type Err = ModelError
type Err = ModelError
The associated error which can be returned from parsing.
Source§impl Hash for JitterPolicy
impl Hash for JitterPolicy
Source§impl PartialEq for JitterPolicy
impl PartialEq for JitterPolicy
Source§impl Serialize for JitterPolicy
impl Serialize for JitterPolicy
impl Copy for JitterPolicy
impl Eq for JitterPolicy
impl StructuralPartialEq for JitterPolicy
Auto Trait Implementations§
impl Freeze for JitterPolicy
impl RefUnwindSafe for JitterPolicy
impl Send for JitterPolicy
impl Sync for JitterPolicy
impl Unpin for JitterPolicy
impl UnsafeUnpin for JitterPolicy
impl UnwindSafe for JitterPolicy
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