pub trait RangeDefault: MinValue + MaxValue {
const RANGE_MIN: Self;
const RANGE_HALF: Self;
const RANGE_MAX: Self;
const RANGE: Self;
// Provided methods
fn range() -> Range<Self> ⓘ { ... }
fn range_inclusive() -> RangeInclusive<Self> { ... }
}Expand description
For floating the range is : [0., 1.]. For integers the range is : [0, MAX], even for signed
Required Associated Constants§
const RANGE_MIN: Self
Sourceconst RANGE_HALF: Self
const RANGE_HALF: Self
Useful for stuff like Color::GRAY
RANGE / 2 + RANGE
const RANGE_MAX: Self
Provided Methods§
fn range() -> Range<Self> ⓘ
fn range_inclusive() -> RangeInclusive<Self>
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.