Trait tor_basic_utils::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.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl GenRangeInfallible for Duration

source§

fn lower_bound() -> Self

Implementors§