Trait nanorand::gen::RandomRange
source · pub trait RandomRange<Generator: Rng<OUTPUT>, const OUTPUT: usize>: RandomGen<Generator, OUTPUT> {
// Required method
fn random_range<Bounds: RangeBounds<Self>>(
nng: &mut Generator,
range: Bounds
) -> Self;
}
Expand description
A trait used for generating a random number within a range, with an RNG,
Required Methods§
sourcefn random_range<Bounds: RangeBounds<Self>>(
nng: &mut Generator,
range: Bounds
) -> Self
fn random_range<Bounds: RangeBounds<Self>>( nng: &mut Generator, range: Bounds ) -> Self
Return a ranged number of the implementing type, from the specified RNG instance.
Panics
This function will panic if the lower bound of the range is greater than the upper bound.