pub struct DefaultJitter { /* private fields */ }Expand description
Production Jitter: a tiny, hand-rolled SplitMix64 PRNG (no external
dependency).
Seeded once at construction from a one-time nanosecond clock sample XORed
with a monotonically advancing process counter; each
jitter01 advances the 64-bit state and maps the top 53
bits to a [0, 1) double. SplitMix64 is the standard seeding PRNG (it is
what rand’s SeedableRng::seed_from_u64 uses internally) and is more than
adequate for jitter — this is decorrelation, not cryptography.
Interior mutability (AtomicU64) lets jitter01 take &self (matching
the trait) while still advancing the stream, so a single instance can be
shared across the retry loop.
Implementations§
Source§impl DefaultJitter
impl DefaultJitter
Trait Implementations§
Source§impl Debug for DefaultJitter
impl Debug for DefaultJitter
Source§impl Default for DefaultJitter
impl Default for DefaultJitter
Auto Trait Implementations§
impl !Freeze for DefaultJitter
impl RefUnwindSafe for DefaultJitter
impl Send for DefaultJitter
impl Sync for DefaultJitter
impl Unpin for DefaultJitter
impl UnsafeUnpin for DefaultJitter
impl UnwindSafe for DefaultJitter
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::RequestCreates a shared type from an unshared type.