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§
type RangeBound
Required Methods§
Sourcefn gen_range(prng: &Prng, r: impl RangeBounds<Self::RangeBound>) -> Self
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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.