Struct std::rand::reseeding::ReseedingRng
[−]
[src]
pub struct ReseedingRng<R, Rsdr> { rng: R, generation_threshold: usize, bytes_generated: usize, pub reseeder: Rsdr, }
Unstable (
rand
): use rand
from crates.io
A wrapper around any RNG which reseeds the underlying RNG after it has generated a certain number of random bytes.
Fields
rng | Unstable ( rand ): use |
generation_threshold | Unstable ( rand ): use |
bytes_generated | Unstable ( rand ): use |
reseeder | Unstable ( rand ): use Controls the behaviour when reseeding the RNG. |
Methods
impl<R, Rsdr> ReseedingRng<R, Rsdr> where R: Rng, Rsdr: Reseeder<R>
fn new(rng: R, generation_threshold: usize, reseeder: Rsdr) -> ReseedingRng<R, Rsdr>
Unstable (
rand
): use rand
from crates.io
Create a new ReseedingRng
with the given parameters.
Arguments
rng
: the random number generator to use.generation_threshold
: the number of bytes of entropy at which to reseed the RNG.reseeder
: the reseeding object to use.
fn reseed_if_necessary(&mut self)
Unstable (
rand
): use rand
from crates.io
Reseed the internal RNG if the number of bytes that have been generated exceed the threshold.