pub trait NumInRange: Steppable + Add<Output = Self> + Clone + PartialOrd + Ord + PartialEq + Eq {
    const MIN_DECR_IS_UNDERFLOW: bool;
    const MAX_INCR_IS_OVERFLOW: bool;

    // Required methods
    fn min_value() -> Self;
    fn max_value() -> Self;
}
Expand description

Trait representing number types over which intervals can be constructed.

Safety

This trait is not unsafe, so do not use custom implementers of this trait in unsafe contexts (e.g. a custom NumInRange as indexes to track initialized buckets in a custom HashMap) without auditing the exact implementation.

Required Associated Constants§

source

const MIN_DECR_IS_UNDERFLOW: bool

Whether caling Steppable::step_decr on the min value would underflow the type.

source

const MAX_INCR_IS_OVERFLOW: bool

Whether caling Steppable::step_incr on the max value would overflow the type.

Required Methods§

source

fn min_value() -> Self

Return the minimum possible value the number can take.

source

fn max_value() -> Self

Return the maximum possible value the number can take.

Implementors§