Expand description
Test and benchmark utilities for generating random data.
This module provides helper functions for tests and benchmarks that need random data generation. These functions replace the functionality previously provided by winter-rand-utils.
§no_std Compatibility
This module provides both std-dependent and no_std-compatible functions:
stdrequired:rand_value,rand_array,rand_vectoruse the thread-local RNG and require thestdfeature.no_stdcompatible:seeded_rng,prng_array,prng_vectoruse deterministic seeded PRNGs and work inno_stdenvironments.
For tests that should run in no_std mode, prefer using seeded_rng to obtain
a deterministic RNG instead of rand::rng().
Structs§
- Continuous
Rng - A continuous random number generator that works in
no-stdcontexts.
Functions§
- prng_
array - Generates a deterministic array using a PRNG seeded with the provided seed.
- prng_
value - Generates a deterministic value using a PRNG seeded with the provided seed.
- prng_
vector - Generates a deterministic vector using a PRNG seeded with the provided seed.
- rand_
array - Generates a random array of type T with N elements.
- rand_
value - Generates a random value of type T using the thread-local random number generator.
- rand_
vector - Generates a random vector of type T with the specified length.
- seeded_
rng - Creates a deterministic seeded RNG suitable for tests.