RangePattern

Trait RangePattern 

Source
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 #123646)
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§

Source

const MIN: Self

🔬This is a nightly-only experimental API. (pattern_type_range_trait #123646)

Trait version of the inherent MIN assoc const.

Source

const MAX: Self

🔬This is a nightly-only experimental API. (pattern_type_range_trait #123646)

Trait version of the inherent MIN assoc const.

Required Methods§

Source

fn sub_one(self) -> Self

🔬This is a nightly-only experimental API. (pattern_type_range_trait #123646)

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.

Implementors§

Source§

impl RangePattern for char

Source§

const MIN: Self = char::MIN

Source§

const MAX: Self = char::MAX

Source§

impl RangePattern for i8

Source§

const MIN: i8 = i8::MIN

Source§

const MAX: i8 = i8::MAX

Source§

impl RangePattern for i16

Source§

const MIN: i16 = i16::MIN

Source§

const MAX: i16 = i16::MAX

Source§

impl RangePattern for i32

Source§

const MIN: i32 = i32::MIN

Source§

const MAX: i32 = i32::MAX

Source§

impl RangePattern for i64

Source§

const MIN: i64 = i64::MIN

Source§

const MAX: i64 = i64::MAX

Source§

impl RangePattern for i128

Source§

const MIN: i128 = i128::MIN

Source§

const MAX: i128 = i128::MAX

Source§

impl RangePattern for isize

Source§

const MIN: isize = isize::MIN

Source§

const MAX: isize = isize::MAX

Source§

impl RangePattern for u8

Source§

const MIN: u8 = u8::MIN

Source§

const MAX: u8 = u8::MAX

Source§

impl RangePattern for u16

Source§

const MIN: u16 = u16::MIN

Source§

const MAX: u16 = u16::MAX

Source§

impl RangePattern for u32

Source§

const MIN: u32 = u32::MIN

Source§

const MAX: u32 = u32::MAX

Source§

impl RangePattern for u64

Source§

const MIN: u64 = u64::MIN

Source§

const MAX: u64 = u64::MAX

Source§

impl RangePattern for u128

Source§

const MIN: u128 = u128::MIN

Source§

const MAX: u128 = u128::MAX

Source§

impl RangePattern for usize

Source§

const MIN: usize = usize::MIN

Source§

const MAX: usize = usize::MAX