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§

source

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.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<Generator: Rng<OUTPUT>, const OUTPUT: usize> RandomRange<Generator, OUTPUT> for i8

source§

fn random_range<Bounds: RangeBounds<Self>>( r: &mut Generator, bounds: Bounds, ) -> Self

source§

impl<Generator: Rng<OUTPUT>, const OUTPUT: usize> RandomRange<Generator, OUTPUT> for i16

source§

fn random_range<Bounds: RangeBounds<Self>>( r: &mut Generator, bounds: Bounds, ) -> Self

source§

impl<Generator: Rng<OUTPUT>, const OUTPUT: usize> RandomRange<Generator, OUTPUT> for i32

source§

fn random_range<Bounds: RangeBounds<Self>>( r: &mut Generator, bounds: Bounds, ) -> Self

source§

impl<Generator: Rng<OUTPUT>, const OUTPUT: usize> RandomRange<Generator, OUTPUT> for i64

source§

fn random_range<Bounds: RangeBounds<Self>>( r: &mut Generator, bounds: Bounds, ) -> Self

source§

impl<Generator: Rng<OUTPUT>, const OUTPUT: usize> RandomRange<Generator, OUTPUT> for isize

source§

fn random_range<Bounds: RangeBounds<Self>>( r: &mut Generator, bounds: Bounds, ) -> Self

source§

impl<Generator: Rng<OUTPUT>, const OUTPUT: usize> RandomRange<Generator, OUTPUT> for u8

source§

fn random_range<Bounds: RangeBounds<Self>>( rng: &mut Generator, bounds: Bounds, ) -> Self

source§

impl<Generator: Rng<OUTPUT>, const OUTPUT: usize> RandomRange<Generator, OUTPUT> for u16

source§

fn random_range<Bounds: RangeBounds<Self>>( rng: &mut Generator, bounds: Bounds, ) -> Self

source§

impl<Generator: Rng<OUTPUT>, const OUTPUT: usize> RandomRange<Generator, OUTPUT> for u32

source§

fn random_range<Bounds: RangeBounds<Self>>( rng: &mut Generator, bounds: Bounds, ) -> Self

source§

impl<Generator: Rng<OUTPUT>, const OUTPUT: usize> RandomRange<Generator, OUTPUT> for u64

source§

fn random_range<Bounds: RangeBounds<Self>>( rng: &mut Generator, bounds: Bounds, ) -> Self

source§

impl<Generator: Rng<OUTPUT>, const OUTPUT: usize> RandomRange<Generator, OUTPUT> for usize

source§

fn random_range<Bounds: RangeBounds<Self>>( rng: &mut Generator, bounds: Bounds, ) -> Self

Implementors§