pub trait GenRangeInfallible: SampleUniform + Ordwhere
RangeInclusive<Self>: SampleRange<Self>,{
// Required method
fn lower_bound() -> Self;
}Expand description
Types that can be infallibly sampled using gen_range_infallible
In addition to the supertraits, the implementor of this trait must guarantee that:
<Self as GenRangeInfallible>::lower_bound() ..= UPPER
is a nonempty range for every value of UPPER.
Required Methods§
Sourcefn lower_bound() -> Self
fn lower_bound() -> Self
The usual lower bound, for converting a RangeToInclusive to a RangeInclusive
Only makes sense with types with a sensible lower bound, such as zero.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".