pub struct TimestampAnonymizer { /* private fields */ }Expand description
Timestamp anonymizer with epoch shift and optional jitter.
Implementations§
Source§impl TimestampAnonymizer
impl TimestampAnonymizer
Sourcepub fn epoch_shift_only(rng: &mut StdRng) -> Self
pub fn epoch_shift_only(rng: &mut StdRng) -> Self
Create a new anonymizer with epoch shift only.
Sourcepub fn with_jitter(jitter_ms: u32, rng: &mut StdRng) -> Self
pub fn with_jitter(jitter_ms: u32, rng: &mut StdRng) -> Self
Create a new anonymizer with epoch shift and bounded jitter.
Sourcepub fn anonymize(&mut self, ts: Duration) -> Duration
pub fn anonymize(&mut self, ts: Duration) -> Duration
Anonymize a single timestamp.
Applies the epoch offset and optional jitter.
Sourcepub fn epoch_offset(&self) -> Duration
pub fn epoch_offset(&self) -> Duration
The fixed epoch offset applied to all timestamps.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TimestampAnonymizer
impl RefUnwindSafe for TimestampAnonymizer
impl Send for TimestampAnonymizer
impl Sync for TimestampAnonymizer
impl Unpin for TimestampAnonymizer
impl UnsafeUnpin for TimestampAnonymizer
impl UnwindSafe for TimestampAnonymizer
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
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 more