par_rand

Function par_rand 

Source
pub fn par_rand<InnerR, T, F>(
    n: usize,
    rng: impl Rng,
    f: F,
) -> impl IndexedParallelIterator<Item = T>
where InnerR: SeedableRng, InnerR::Seed: Send + Sync, T: Send, F: Fn(InnerR) -> T + Sync + Send,
Expand description

Generates random values in parallel using a deterministic per-index seeding scheme.

Creates a base seed from the provided RNG, then for each index i in 0..n, XORs the index bytes into the seed to create a unique but deterministic seed for that index’s RNG.