pub struct DeterminismConfig {
pub seed: Option<u64>,
pub freeze_clock: Option<String>,
}Expand description
Configuration for deterministic test execution
Enables reproducible tests by controlling randomness and time:
seed- Fixed random seed for matrix expansionfreeze_clock- Fixed timestamp fornow_rfc3339()function
Fields§
§seed: Option<u64>Random seed for deterministic matrix expansion
freeze_clock: Option<String>Frozen timestamp in RFC3339 format
Implementations§
Source§impl DeterminismConfig
impl DeterminismConfig
Sourcepub fn with_freeze_clock(self, timestamp: String) -> Self
pub fn with_freeze_clock(self, timestamp: String) -> Self
Set frozen clock timestamp
Sourcepub fn is_deterministic(&self) -> bool
pub fn is_deterministic(&self) -> bool
Check if any determinism features are enabled
Sourcepub fn has_frozen_clock(&self) -> bool
pub fn has_frozen_clock(&self) -> bool
Check if clock is frozen
Sourcepub fn get_freeze_clock(&self) -> Option<&str>
pub fn get_freeze_clock(&self) -> Option<&str>
Get the frozen clock timestamp if set
Trait Implementations§
Source§impl Clone for DeterminismConfig
impl Clone for DeterminismConfig
Source§fn clone(&self) -> DeterminismConfig
fn clone(&self) -> DeterminismConfig
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 DeterminismConfig
impl Debug for DeterminismConfig
Source§impl Default for DeterminismConfig
impl Default for DeterminismConfig
Source§fn default() -> DeterminismConfig
fn default() -> DeterminismConfig
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for DeterminismConfig
impl<'de> Deserialize<'de> for DeterminismConfig
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
Auto Trait Implementations§
impl Freeze for DeterminismConfig
impl RefUnwindSafe for DeterminismConfig
impl Send for DeterminismConfig
impl Sync for DeterminismConfig
impl Unpin for DeterminismConfig
impl UnwindSafe for DeterminismConfig
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