pub struct ReplicateSeedDeriver { /* private fields */ }Expand description
Lazy source of deterministic, order-independent named replicate seeds.
A namespace identifies one scientific random stream, such as matrix,
pairing, or replacement/task-17. The same base seed, replicate index,
and namespace always produce the same value regardless of process,
scheduling, or request order. Different namespaces are domain-separated.
Implementations§
Source§impl ReplicateSeedDeriver
impl ReplicateSeedDeriver
Sourcepub const fn new(base_seed: u64, replicate_index: u64) -> Self
pub const fn new(base_seed: u64, replicate_index: u64) -> Self
Creates a lazy deriver for one replicate.
Sourcepub const fn replicate_index(self) -> u64
pub const fn replicate_index(self) -> u64
Returns the zero-based replicate index.
Sourcepub fn derive(self, namespace: &str) -> Result<DerivedSeed, RngRecordError>
pub fn derive(self, namespace: &str) -> Result<DerivedSeed, RngRecordError>
Derives one named stream seed and its matching provenance record.
Derivation occurs only when requested. The namespace must be nonblank
and should remain stable across executions. The versioned byte contract
is SHA-256 over the method version, base seed, replicate index, namespace
byte length, and namespace bytes; the first eight digest bytes are read
as a big-endian u64.
Trait Implementations§
Source§impl Clone for ReplicateSeedDeriver
impl Clone for ReplicateSeedDeriver
Source§fn clone(&self) -> ReplicateSeedDeriver
fn clone(&self) -> ReplicateSeedDeriver
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ReplicateSeedDeriver
Source§impl Debug for ReplicateSeedDeriver
impl Debug for ReplicateSeedDeriver
impl Eq for ReplicateSeedDeriver
Source§impl PartialEq for ReplicateSeedDeriver
impl PartialEq for ReplicateSeedDeriver
impl StructuralPartialEq for ReplicateSeedDeriver
Auto Trait Implementations§
impl Freeze for ReplicateSeedDeriver
impl RefUnwindSafe for ReplicateSeedDeriver
impl Send for ReplicateSeedDeriver
impl Sync for ReplicateSeedDeriver
impl Unpin for ReplicateSeedDeriver
impl UnsafeUnpin for ReplicateSeedDeriver
impl UnwindSafe for ReplicateSeedDeriver
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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> ⓘ
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> ⓘ
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