#[non_exhaustive]pub enum JitterPolicy {
Full,
None,
Equal,
Decorrelated,
}Expand description
Jitter applied to a backoff delay.
| Variant | Delay range |
|---|---|
None | base |
Full | [0, base] |
Equal | [base / 2, base] |
Decorrelated | [first, min(base * 3, max)] |
The execution layer applies the selected policy.
§Example
use solti_model::JitterPolicy;
assert_eq!("equal".parse::<JitterPolicy>().unwrap(), JitterPolicy::Equal);
assert_eq!("".parse::<JitterPolicy>().unwrap(), JitterPolicy::Full);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 samples from [base / 2, base].
Memoryless randomized band: delay is sampled uniformly from
[first, min(base * 3, max)].
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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for JitterPolicy
Source§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
impl Eq for JitterPolicy
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 JsonSchema for JitterPolicy
impl JsonSchema for JitterPolicy
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for JitterPolicy
impl PartialEq for JitterPolicy
Source§impl Serialize for JitterPolicy
impl Serialize 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