pub struct ReproConfig {
pub enabled: bool,
pub seed: u64,
}Expand description
Configuration that controls whether deterministic reproducibility is active.
When enabled is true, the runtime seeds all Rng instances from
seed and enforces deterministic reduction ordering.
When enabled is false, the seed field is ignored and the runtime may
use a non-deterministic source.
§Examples
use cjc_repro::ReproConfig;
let cfg = ReproConfig::enabled(42);
assert!(cfg.enabled);
assert_eq!(cfg.seed, 42);
let off = ReproConfig::disabled();
assert!(!off.enabled);Fields§
§enabled: boolWhether reproducibility mode is active.
seed: u64The global seed used to initialize all Rng instances when
reproducibility is enabled.
Implementations§
Source§impl ReproConfig
impl ReproConfig
Sourcepub fn disabled() -> Self
pub fn disabled() -> Self
Creates a ReproConfig with reproducibility disabled.
The seed is set to 0 but will not be used by the runtime.
Sourcepub fn enabled(seed: u64) -> Self
pub fn enabled(seed: u64) -> Self
Creates a ReproConfig with reproducibility enabled using the
given seed.
§Arguments
seed– The global seed that will be threaded through the runtime.
Trait Implementations§
Source§impl Clone for ReproConfig
impl Clone for ReproConfig
Source§fn clone(&self) -> ReproConfig
fn clone(&self) -> ReproConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ReproConfig
impl Debug for ReproConfig
Source§impl Default for ReproConfig
impl Default for ReproConfig
Source§fn default() -> Self
fn default() -> Self
Returns ReproConfig::disabled().
Auto Trait Implementations§
impl Freeze for ReproConfig
impl RefUnwindSafe for ReproConfig
impl Send for ReproConfig
impl Sync for ReproConfig
impl Unpin for ReproConfig
impl UnsafeUnpin for ReproConfig
impl UnwindSafe for ReproConfig
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