Structs§
- Defaultable
Array - Wrapper around an array, that implements Default by copying the default element.
- RngBuffer
Core - Wrapper around an RngCore that fills an 8*[N]-byte buffer at a time in order to make fewer system calls.
- RngBuffer
Wrapper - Wraps an RngBufferCore using a BlockRng64. Also wraps it in an Rc and RefCell so that the buffer will be shared with all clones of the instance in the same thread. (This buffer isn’t meant to be shared between threads, because benchmarks indicate that the overhead cost of communication between threads is usually larger than that of the system call that an OsRng makes.)
- RngWrapper
- Wraps an RNG in an Rc and RefCell so that it can be shared (within the same thread) across structs that expect to own one.
Functions§
- build_
default_ rng - Creates an instance of DefaultRng that uses the given seed source.
- build_
default_ seeder - Creates an instance of DefaultSeedSourceRng that doesn’t share state with any other instance.
- thread_
rng - Obtains this thread’s default DefaultRng, which is identical to rand::thread_rng except that it uses thread_seed_source rather than directly invoking OsRng to reseed itself.
- thread_
seed_ source - Obtains the default DefaultSeedSourceRng for this thread.
Type Aliases§
- Default
Rng - A drop-in replacement for [rand::ThreadRng] that behaves identically, except that it uses an RngBufferCore to wrap the OsRng that it uses to reseed itself.
- Default
Seed Source Rng - A wrapper around OsRng that uses an RngBufferCore with a reasonable default buffer size.