[−][src]Trait nanorand::rand::RNG
A trait that represents a random number generator.
Associated Types
Loading content...Required methods
fn rand(&mut self) -> Self::Output
Generates a random sequence of bytes, seeding from the internal state.
fn rand_with_seed(seed: &[u8]) -> Self::Output
Generates a random sequence of bytes, with a custom seed.
fn reseed(&mut self, new_seed: &[u8])
Reseeds the RNG using a custom seed.
Provided methods
fn generate<R: RandomGen<Self>>(&mut self) -> R
Generates a random of the specified type, seeding from the internal state.
fn generate_range<R: RandomRange<Self>>(&mut self, lower: R, upper: R) -> R
Generates a random of the specified type, seeding from the internal state.
fn shuffle<I, S: AsMut<[I]>>(&mut self, target: S)
Shuffle a slice, using the RNG.