pub struct SystemTimeGenerator { /* private fields */ }Expand description
Generator for SystemTime values
Implementations§
Source§impl SystemTimeGenerator
impl SystemTimeGenerator
Sourcepub fn new(start: SystemTime, max_offset_secs: u64) -> Self
pub fn new(start: SystemTime, max_offset_secs: u64) -> Self
Create a new SystemTime generator
Generates times from start to start + max_offset_secs
Sourcepub fn around_now() -> Self
pub fn around_now() -> Self
Create a generator for times around now (± 1 year)
Sourcepub fn from_epoch(max_offset_secs: u64) -> Self
pub fn from_epoch(max_offset_secs: u64) -> Self
Create a generator starting from Unix epoch
Trait Implementations§
Source§impl Clone for SystemTimeGenerator
impl Clone for SystemTimeGenerator
Source§impl Debug for SystemTimeGenerator
impl Debug for SystemTimeGenerator
Source§impl Generator<SystemTime> for SystemTimeGenerator
impl Generator<SystemTime> for SystemTimeGenerator
Source§fn generate(
&self,
rng: &mut dyn RngCore,
_config: &GeneratorConfig,
) -> SystemTime
fn generate( &self, rng: &mut dyn RngCore, _config: &GeneratorConfig, ) -> SystemTime
Generate a random value of type T using the provided RNG and configuration
Source§fn shrink(&self, value: &SystemTime) -> Box<dyn Iterator<Item = SystemTime>>
fn shrink(&self, value: &SystemTime) -> Box<dyn Iterator<Item = SystemTime>>
Create an iterator of shrunk values from the given value
Auto Trait Implementations§
impl Freeze for SystemTimeGenerator
impl RefUnwindSafe for SystemTimeGenerator
impl Send for SystemTimeGenerator
impl Sync for SystemTimeGenerator
impl Unpin for SystemTimeGenerator
impl UnsafeUnpin 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