pub struct SystemTimeGenerator { /* private fields */ }Expand description
Generator for creating SystemTime values with a specified strategy.
Created from a SystemTimeGenerationMode to enable consistent timestamp
generation across multiple calls.
Implementations§
Source§impl SystemTimeGenerator
impl SystemTimeGenerator
Sourcepub fn new(mode: SystemTimeGenerationMode) -> Self
pub fn new(mode: SystemTimeGenerationMode) -> Self
Create a new SystemTime generator with the specified mode.
Uses SystemTime::now() as the reference point for offset calculations.
Sourcepub fn with_reference(
mode: SystemTimeGenerationMode,
reference: SystemTime,
) -> Self
pub fn with_reference( mode: SystemTimeGenerationMode, reference: SystemTime, ) -> Self
Create a generator with a custom reference time.
Useful for deterministic testing where you want offsets from a known point.
Sourcepub fn mode(&self) -> SystemTimeGenerationMode
pub fn mode(&self) -> SystemTimeGenerationMode
Get the generation mode.
Sourcepub fn reference(&self) -> SystemTime
pub fn reference(&self) -> SystemTime
Get the reference time used for offset calculations.
Trait Implementations§
Source§impl Clone for SystemTimeGenerator
impl Clone for SystemTimeGenerator
Source§fn clone(&self) -> SystemTimeGenerator
fn clone(&self) -> SystemTimeGenerator
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 SystemTimeGenerator
impl Debug for SystemTimeGenerator
Source§impl Generator for SystemTimeGenerator
impl Generator for SystemTimeGenerator
impl Copy for SystemTimeGenerator
Auto Trait Implementations§
impl Freeze for SystemTimeGenerator
impl RefUnwindSafe for SystemTimeGenerator
impl Send for SystemTimeGenerator
impl Sync for SystemTimeGenerator
impl Unpin for SystemTimeGenerator
impl UnwindSafe for SystemTimeGenerator
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