Crate rng_buffer
source ·Structs§
- Wrapper around an array, that implements Default by copying the default element.
- Wrapper around an RngCore that fills an 8*[N]-byte buffer at a time in order to make fewer system calls.
- 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.)
Functions§
- Creates an instance of DefaultRng that uses the given seed source.
- Creates an instance of DefaultSeedSourceRng that doesn’t share state with any other instance.
- 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.
- Obtains the default DefaultSeedSourceRng for this thread.
Type Aliases§
- 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.
- A wrapper around OsRng that uses an RngBufferCore with a reasonable default buffer size.