pub trait GenRange {
    type RangeBound;

    // Required method
    fn gen_range(prng: &Prng, r: impl RangeBounds<Self::RangeBound>) -> Self;
}
Expand description

Implemented by types that support being generated in a specific range by a Prng.

Required Associated Types§

Required Methods§

source

fn gen_range(prng: &Prng, r: impl RangeBounds<Self::RangeBound>) -> Self

Generates a value of the implementing type with the Prng in the specified range.

Panics

If the range is empty.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl GenRange for u64

§

type RangeBound = u64

source§

fn gen_range(prng: &Prng, r: impl RangeBounds<Self::RangeBound>) -> Self

Implementors§