Trait RangePattern
pub trait RangePattern {
const MIN: Self;
const MAX: Self;
// Required method
fn sub_one(self) -> Self;
}🔬This is a nightly-only experimental API. (
pattern_type_range_trait)Expand description
A trait implemented for integer types and char.
Useful in the future for generic pattern types, but
used right now to simplify ast lowering of pattern type ranges.
Required Associated Constants§
const MIN: Self
🔬This is a nightly-only experimental API. (pattern_type_range_trait)
const MIN: Self
pattern_type_range_trait)Trait version of the inherent MIN assoc const.
const MAX: Self
🔬This is a nightly-only experimental API. (pattern_type_range_trait)
const MAX: Self
pattern_type_range_trait)Trait version of the inherent MIN assoc const.
Required Methods§
fn sub_one(self) -> Self
🔬This is a nightly-only experimental API. (pattern_type_range_trait)
fn sub_one(self) -> Self
pattern_type_range_trait)A compile-time helper to subtract 1 for exclusive ranges.
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.