pub struct DeterministicState {
pub enabled: bool,
pub global_seed: u64,
pub operation_counter: u64,
pub strict_mode: bool,
pub prefer_deterministic_algorithms: bool,
pub operation_log: Vec<String>,
pub max_log_size: usize,
}Expand description
Global deterministic mode state
Fields§
§enabled: boolWhether deterministic mode is enabled
global_seed: u64Global random seed
operation_counter: u64Current operation counter for subseed generation
strict_mode: boolWhether to enforce determinism strictly (fail on non-deterministic ops)
prefer_deterministic_algorithms: boolWhether to use deterministic algorithms even if slower
operation_log: Vec<String>Track which operations have been executed for reproducibility
max_log_size: usizeMaximum size of operation log
Implementations§
Source§impl DeterministicState
impl DeterministicState
Sourcepub fn next_subseed(&mut self, operation_name: &str) -> u64
pub fn next_subseed(&mut self, operation_name: &str) -> u64
Get the next subseed for an operation
Sourcepub fn reset_counter(&mut self)
pub fn reset_counter(&mut self)
Reset the operation counter
Sourcepub fn snapshot(&self) -> DeterministicSnapshot
pub fn snapshot(&self) -> DeterministicSnapshot
Get a snapshot of the current state for reproducibility
Sourcepub fn restore(&mut self, snapshot: &DeterministicSnapshot)
pub fn restore(&mut self, snapshot: &DeterministicSnapshot)
Restore from a snapshot
Trait Implementations§
Source§impl Clone for DeterministicState
impl Clone for DeterministicState
Source§fn clone(&self) -> DeterministicState
fn clone(&self) -> DeterministicState
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 DeterministicState
impl Debug for DeterministicState
Auto Trait Implementations§
impl Freeze for DeterministicState
impl RefUnwindSafe for DeterministicState
impl Send for DeterministicState
impl Sync for DeterministicState
impl Unpin for DeterministicState
impl UnsafeUnpin for DeterministicState
impl UnwindSafe for DeterministicState
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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