Trait GenRangeInfallible

Source
pub trait GenRangeInfallible: SampleUniform + Ord
where 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§

Source

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", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl GenRangeInfallible for Duration

Source§

fn lower_bound() -> Self

Implementors§