Struct konst::cmp::CmpWrapper

source ·
pub struct CmpWrapper<T>(pub T);
Expand description

A wrapper type for std types, which defines const_eq and const_cmp methods for them.

This is what coerce_to_cmp and the comparison macros convert standard library types into.

§Example

use konst::{
    cmp::CmpWrapper,
    coerce_to_cmp,
};

use std::cmp::Ordering;

{
    // The `CmpWrapper<u32>` type annotation is just for the reader
    let foo: CmpWrapper<u32> = coerce_to_cmp!(10u32);
    assert!( foo.const_eq(&10));
    assert!(!foo.const_eq(&20));
     
    assert_eq!(foo.const_cmp(&5), Ordering::Greater);
    assert_eq!(foo.const_cmp(&10), Ordering::Equal);
    assert_eq!(foo.const_cmp(&15), Ordering::Less);
}
{
    let bar = CmpWrapper(Ordering::Equal);
    assert!( bar.const_eq(&Ordering::Equal));
    assert!(!bar.const_eq(&Ordering::Less));
     
    assert_eq!(bar.const_cmp(&Ordering::Less), Ordering::Greater);
    assert_eq!(bar.const_cmp(&Ordering::Equal), Ordering::Equal);
    assert_eq!(bar.const_cmp(&Ordering::Greater), Ordering::Less);
}

Tuple Fields§

§0: T

Implementations§

source§

impl<'a, T> CmpWrapper<&'a [T]>

source

pub const fn slice(x: &'a [T]) -> Self

For constructing from a reference to an array.

With slices you can do CmpWrapper(slice) as well.

source§

impl CmpWrapper<i8>

source

pub const fn const_eq(self, other: &i8) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<u8>

source

pub const fn const_eq(self, other: &u8) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<i16>

source

pub const fn const_eq(self, other: &i16) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<u16>

source

pub const fn const_eq(self, other: &u16) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<i32>

source

pub const fn const_eq(self, other: &i32) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<u32>

source

pub const fn const_eq(self, other: &u32) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<i64>

source

pub const fn const_eq(self, other: &i64) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<u64>

source

pub const fn const_eq(self, other: &u64) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<i128>

source

pub const fn const_eq(self, other: &i128) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<u128>

source

pub const fn const_eq(self, other: &u128) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<isize>

source

pub const fn const_eq(self, other: &isize) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<usize>

source

pub const fn const_eq(self, other: &usize) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<bool>

source

pub const fn const_eq(self, other: &bool) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<char>

source

pub const fn const_eq(self, other: &char) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<u8>

source

pub const fn const_cmp(&self, other: &u8) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<u16>

source

pub const fn const_cmp(&self, other: &u16) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<u32>

source

pub const fn const_cmp(&self, other: &u32) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<u64>

source

pub const fn const_cmp(&self, other: &u64) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<u128>

source

pub const fn const_cmp(&self, other: &u128) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<usize>

source

pub const fn const_cmp(&self, other: &usize) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<i8>

source

pub const fn const_cmp(&self, other: &i8) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<i16>

source

pub const fn const_cmp(&self, other: &i16) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<i32>

source

pub const fn const_cmp(&self, other: &i32) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<i64>

source

pub const fn const_cmp(&self, other: &i64) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<i128>

source

pub const fn const_cmp(&self, other: &i128) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<isize>

source

pub const fn const_cmp(&self, other: &isize) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<bool>

source

pub const fn const_cmp(&self, other: &bool) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<char>

source

pub const fn const_cmp(&self, other: &char) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<Option<u8>>

source

pub const fn const_eq(&self, other: &Option<u8>) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<Option<u8>>

source

pub const fn const_cmp(&self, other: &Option<u8>) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<Option<i8>>

source

pub const fn const_eq(&self, other: &Option<i8>) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<Option<i8>>

source

pub const fn const_cmp(&self, other: &Option<i8>) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<Option<u16>>

source

pub const fn const_eq(&self, other: &Option<u16>) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<Option<u16>>

source

pub const fn const_cmp(&self, other: &Option<u16>) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<Option<i16>>

source

pub const fn const_eq(&self, other: &Option<i16>) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<Option<i16>>

source

pub const fn const_cmp(&self, other: &Option<i16>) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<Option<u32>>

source

pub const fn const_eq(&self, other: &Option<u32>) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<Option<u32>>

source

pub const fn const_cmp(&self, other: &Option<u32>) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<Option<i32>>

source

pub const fn const_eq(&self, other: &Option<i32>) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<Option<i32>>

source

pub const fn const_cmp(&self, other: &Option<i32>) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<Option<u64>>

source

pub const fn const_eq(&self, other: &Option<u64>) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<Option<u64>>

source

pub const fn const_cmp(&self, other: &Option<u64>) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<Option<i64>>

source

pub const fn const_eq(&self, other: &Option<i64>) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<Option<i64>>

source

pub const fn const_cmp(&self, other: &Option<i64>) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<Option<u128>>

source

pub const fn const_eq(&self, other: &Option<u128>) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<Option<u128>>

source

pub const fn const_cmp(&self, other: &Option<u128>) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<Option<i128>>

source

pub const fn const_eq(&self, other: &Option<i128>) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<Option<i128>>

source

pub const fn const_cmp(&self, other: &Option<i128>) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<Option<usize>>

source

pub const fn const_eq(&self, other: &Option<usize>) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<Option<usize>>

source

pub const fn const_cmp(&self, other: &Option<usize>) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<Option<isize>>

source

pub const fn const_eq(&self, other: &Option<isize>) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<Option<isize>>

source

pub const fn const_cmp(&self, other: &Option<isize>) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<Option<bool>>

source

pub const fn const_eq(&self, other: &Option<bool>) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<Option<bool>>

source

pub const fn const_cmp(&self, other: &Option<bool>) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<Option<char>>

source

pub const fn const_eq(&self, other: &Option<char>) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<Option<char>>

source

pub const fn const_cmp(&self, other: &Option<char>) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<Range<u8>>

source

pub const fn const_eq(&self, other: &Range<u8>) -> bool

Compares self and other for equality.

source§

impl<'a> CmpWrapper<&'a Range<u8>>

source

pub const fn const_eq(&self, other: &'a Range<u8>) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<Range<u16>>

source

pub const fn const_eq(&self, other: &Range<u16>) -> bool

Compares self and other for equality.

source§

impl<'a> CmpWrapper<&'a Range<u16>>

source

pub const fn const_eq(&self, other: &'a Range<u16>) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<Range<u32>>

source

pub const fn const_eq(&self, other: &Range<u32>) -> bool

Compares self and other for equality.

source§

impl<'a> CmpWrapper<&'a Range<u32>>

source

pub const fn const_eq(&self, other: &'a Range<u32>) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<Range<u64>>

source

pub const fn const_eq(&self, other: &Range<u64>) -> bool

Compares self and other for equality.

source§

impl<'a> CmpWrapper<&'a Range<u64>>

source

pub const fn const_eq(&self, other: &'a Range<u64>) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<Range<u128>>

source

pub const fn const_eq(&self, other: &Range<u128>) -> bool

Compares self and other for equality.

source§

impl<'a> CmpWrapper<&'a Range<u128>>

source

pub const fn const_eq(&self, other: &'a Range<u128>) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<Range<usize>>

source

pub const fn const_eq(&self, other: &Range<usize>) -> bool

Compares self and other for equality.

source§

impl<'a> CmpWrapper<&'a Range<usize>>

source

pub const fn const_eq(&self, other: &'a Range<usize>) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<Range<char>>

source

pub const fn const_eq(&self, other: &Range<char>) -> bool

Compares self and other for equality.

source§

impl<'a> CmpWrapper<&'a Range<char>>

source

pub const fn const_eq(&self, other: &'a Range<char>) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<RangeInclusive<u8>>

source

pub const fn const_eq(&self, other: &RangeInclusive<u8>) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<RangeInclusive<u16>>

source

pub const fn const_eq(&self, other: &RangeInclusive<u16>) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<RangeInclusive<u32>>

source

pub const fn const_eq(&self, other: &RangeInclusive<u32>) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<RangeInclusive<u64>>

source

pub const fn const_eq(&self, other: &RangeInclusive<u64>) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<RangeInclusive<u128>>

source

pub const fn const_eq(&self, other: &RangeInclusive<u128>) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<RangeInclusive<usize>>

source

pub const fn const_eq(&self, other: &RangeInclusive<usize>) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<RangeInclusive<char>>

source

pub const fn const_eq(&self, other: &RangeInclusive<char>) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<NonZeroU8>

source

pub const fn const_eq(&self, other: &NonZeroU8) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<NonZeroU8>

source

pub const fn const_cmp(&self, other: &NonZeroU8) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<NonZeroI8>

source

pub const fn const_eq(&self, other: &NonZeroI8) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<NonZeroI8>

source

pub const fn const_cmp(&self, other: &NonZeroI8) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<NonZeroU16>

source

pub const fn const_eq(&self, other: &NonZeroU16) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<NonZeroU16>

source

pub const fn const_cmp(&self, other: &NonZeroU16) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<NonZeroI16>

source

pub const fn const_eq(&self, other: &NonZeroI16) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<NonZeroI16>

source

pub const fn const_cmp(&self, other: &NonZeroI16) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<NonZeroU32>

source

pub const fn const_eq(&self, other: &NonZeroU32) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<NonZeroU32>

source

pub const fn const_cmp(&self, other: &NonZeroU32) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<NonZeroI32>

source

pub const fn const_eq(&self, other: &NonZeroI32) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<NonZeroI32>

source

pub const fn const_cmp(&self, other: &NonZeroI32) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<NonZeroU64>

source

pub const fn const_eq(&self, other: &NonZeroU64) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<NonZeroU64>

source

pub const fn const_cmp(&self, other: &NonZeroU64) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<NonZeroI64>

source

pub const fn const_eq(&self, other: &NonZeroI64) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<NonZeroI64>

source

pub const fn const_cmp(&self, other: &NonZeroI64) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<NonZeroU128>

source

pub const fn const_eq(&self, other: &NonZeroU128) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<NonZeroU128>

source

pub const fn const_cmp(&self, other: &NonZeroU128) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<NonZeroI128>

source

pub const fn const_eq(&self, other: &NonZeroI128) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<NonZeroI128>

source

pub const fn const_cmp(&self, other: &NonZeroI128) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<NonZeroUsize>

source

pub const fn const_eq(&self, other: &NonZeroUsize) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<NonZeroUsize>

source

pub const fn const_cmp(&self, other: &NonZeroUsize) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<NonZeroIsize>

source

pub const fn const_eq(&self, other: &NonZeroIsize) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<NonZeroIsize>

source

pub const fn const_cmp(&self, other: &NonZeroIsize) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<Option<NonZeroU8>>

source

pub const fn const_eq(&self, other: &Option<NonZeroU8>) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<Option<NonZeroU8>>

source

pub const fn const_cmp(&self, other: &Option<NonZeroU8>) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<Option<NonZeroI8>>

source

pub const fn const_eq(&self, other: &Option<NonZeroI8>) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<Option<NonZeroI8>>

source

pub const fn const_cmp(&self, other: &Option<NonZeroI8>) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<Option<NonZeroU16>>

source

pub const fn const_eq(&self, other: &Option<NonZeroU16>) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<Option<NonZeroU16>>

source

pub const fn const_cmp(&self, other: &Option<NonZeroU16>) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<Option<NonZeroI16>>

source

pub const fn const_eq(&self, other: &Option<NonZeroI16>) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<Option<NonZeroI16>>

source

pub const fn const_cmp(&self, other: &Option<NonZeroI16>) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<Option<NonZeroU32>>

source

pub const fn const_eq(&self, other: &Option<NonZeroU32>) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<Option<NonZeroU32>>

source

pub const fn const_cmp(&self, other: &Option<NonZeroU32>) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<Option<NonZeroI32>>

source

pub const fn const_eq(&self, other: &Option<NonZeroI32>) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<Option<NonZeroI32>>

source

pub const fn const_cmp(&self, other: &Option<NonZeroI32>) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<Option<NonZeroU64>>

source

pub const fn const_eq(&self, other: &Option<NonZeroU64>) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<Option<NonZeroU64>>

source

pub const fn const_cmp(&self, other: &Option<NonZeroU64>) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<Option<NonZeroI64>>

source

pub const fn const_eq(&self, other: &Option<NonZeroI64>) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<Option<NonZeroI64>>

source

pub const fn const_cmp(&self, other: &Option<NonZeroI64>) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<Option<NonZeroU128>>

source

pub const fn const_eq(&self, other: &Option<NonZeroU128>) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<Option<NonZeroU128>>

source

pub const fn const_cmp(&self, other: &Option<NonZeroU128>) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<Option<NonZeroI128>>

source

pub const fn const_eq(&self, other: &Option<NonZeroI128>) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<Option<NonZeroI128>>

source

pub const fn const_cmp(&self, other: &Option<NonZeroI128>) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<Option<NonZeroUsize>>

source

pub const fn const_eq(&self, other: &Option<NonZeroUsize>) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<Option<NonZeroUsize>>

source

pub const fn const_cmp(&self, other: &Option<NonZeroUsize>) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<Option<NonZeroIsize>>

source

pub const fn const_eq(&self, other: &Option<NonZeroIsize>) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<Option<NonZeroIsize>>

source

pub const fn const_cmp(&self, other: &Option<NonZeroIsize>) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<Ordering>

source

pub const fn const_eq(&self, other: &Ordering) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<Ordering>

source

pub const fn const_cmp(&self, other: &Ordering) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<Option<Ordering>>

source

pub const fn const_eq(&self, other: &Option<Ordering>) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<Option<Ordering>>

source

pub const fn const_cmp(&self, other: &Option<Ordering>) -> Ordering

Compares self and other for ordering.

source§

impl<T> CmpWrapper<PhantomData<T>>

source

pub const fn const_eq(&self, other: &PhantomData<T>) -> bool

Compares self and other for equality.

source§

impl<T> CmpWrapper<PhantomData<T>>

source

pub const fn const_cmp(&self, other: &PhantomData<T>) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<PhantomPinned>

source

pub const fn const_eq(&self, other: &PhantomPinned) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<PhantomPinned>

source

pub const fn const_cmp(&self, other: &PhantomPinned) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<&[u16]>

source

pub const fn const_eq(&self, other: &[u16]) -> bool

Compares self and other for equality.

source§

impl<'a> CmpWrapper<&[u16]>

source

pub const fn const_cmp(&self, other: &[u16]) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<&[u32]>

source

pub const fn const_eq(&self, other: &[u32]) -> bool

Compares self and other for equality.

source§

impl<'a> CmpWrapper<&[u32]>

source

pub const fn const_cmp(&self, other: &[u32]) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<&[u64]>

source

pub const fn const_eq(&self, other: &[u64]) -> bool

Compares self and other for equality.

source§

impl<'a> CmpWrapper<&[u64]>

source

pub const fn const_cmp(&self, other: &[u64]) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<&[u128]>

source

pub const fn const_eq(&self, other: &[u128]) -> bool

Compares self and other for equality.

source§

impl<'a> CmpWrapper<&[u128]>

source

pub const fn const_cmp(&self, other: &[u128]) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<&[usize]>

source

pub const fn const_eq(&self, other: &[usize]) -> bool

Compares self and other for equality.

source§

impl<'a> CmpWrapper<&[usize]>

source

pub const fn const_cmp(&self, other: &[usize]) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<&[i8]>

source

pub const fn const_eq(&self, other: &[i8]) -> bool

Compares self and other for equality.

source§

impl<'a> CmpWrapper<&[i8]>

source

pub const fn const_cmp(&self, other: &[i8]) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<&[i16]>

source

pub const fn const_eq(&self, other: &[i16]) -> bool

Compares self and other for equality.

source§

impl<'a> CmpWrapper<&[i16]>

source

pub const fn const_cmp(&self, other: &[i16]) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<&[i32]>

source

pub const fn const_eq(&self, other: &[i32]) -> bool

Compares self and other for equality.

source§

impl<'a> CmpWrapper<&[i32]>

source

pub const fn const_cmp(&self, other: &[i32]) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<&[i64]>

source

pub const fn const_eq(&self, other: &[i64]) -> bool

Compares self and other for equality.

source§

impl<'a> CmpWrapper<&[i64]>

source

pub const fn const_cmp(&self, other: &[i64]) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<&[i128]>

source

pub const fn const_eq(&self, other: &[i128]) -> bool

Compares self and other for equality.

source§

impl<'a> CmpWrapper<&[i128]>

source

pub const fn const_cmp(&self, other: &[i128]) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<&[isize]>

source

pub const fn const_eq(&self, other: &[isize]) -> bool

Compares self and other for equality.

source§

impl<'a> CmpWrapper<&[isize]>

source

pub const fn const_cmp(&self, other: &[isize]) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<&[bool]>

source

pub const fn const_eq(&self, other: &[bool]) -> bool

Compares self and other for equality.

source§

impl<'a> CmpWrapper<&[bool]>

source

pub const fn const_cmp(&self, other: &[bool]) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<&[char]>

source

pub const fn const_eq(&self, other: &[char]) -> bool

Compares self and other for equality.

source§

impl<'a> CmpWrapper<&[char]>

source

pub const fn const_cmp(&self, other: &[char]) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<&[&str]>

source

pub const fn const_eq(&self, other: &[&str]) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<&[&str]>

source

pub const fn const_cmp(&self, other: &[&str]) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<&[&[u8]]>

source

pub const fn const_eq(&self, other: &[&[u8]]) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<&[&[u8]]>

source

pub const fn const_cmp(&self, other: &[&[u8]]) -> Ordering

Compares self and other for ordering.

source§

impl<'a> CmpWrapper<Option<&'a [u16]>>

source

pub const fn const_eq(&self, other: &Option<&'a [u16]>) -> bool

Compares self and other for equality.

source§

impl<'a> CmpWrapper<Option<&'a [u16]>>

source

pub const fn const_cmp(&self, other: &Option<&'a [u16]>) -> Ordering

Compares self and other for ordering.

source§

impl<'a> CmpWrapper<Option<&'a [u32]>>

source

pub const fn const_eq(&self, other: &Option<&'a [u32]>) -> bool

Compares self and other for equality.

source§

impl<'a> CmpWrapper<Option<&'a [u32]>>

source

pub const fn const_cmp(&self, other: &Option<&'a [u32]>) -> Ordering

Compares self and other for ordering.

source§

impl<'a> CmpWrapper<Option<&'a [u64]>>

source

pub const fn const_eq(&self, other: &Option<&'a [u64]>) -> bool

Compares self and other for equality.

source§

impl<'a> CmpWrapper<Option<&'a [u64]>>

source

pub const fn const_cmp(&self, other: &Option<&'a [u64]>) -> Ordering

Compares self and other for ordering.

source§

impl<'a> CmpWrapper<Option<&'a [u128]>>

source

pub const fn const_eq(&self, other: &Option<&'a [u128]>) -> bool

Compares self and other for equality.

source§

impl<'a> CmpWrapper<Option<&'a [u128]>>

source

pub const fn const_cmp(&self, other: &Option<&'a [u128]>) -> Ordering

Compares self and other for ordering.

source§

impl<'a> CmpWrapper<Option<&'a [usize]>>

source

pub const fn const_eq(&self, other: &Option<&'a [usize]>) -> bool

Compares self and other for equality.

source§

impl<'a> CmpWrapper<Option<&'a [usize]>>

source

pub const fn const_cmp(&self, other: &Option<&'a [usize]>) -> Ordering

Compares self and other for ordering.

source§

impl<'a> CmpWrapper<Option<&'a [i8]>>

source

pub const fn const_eq(&self, other: &Option<&'a [i8]>) -> bool

Compares self and other for equality.

source§

impl<'a> CmpWrapper<Option<&'a [i8]>>

source

pub const fn const_cmp(&self, other: &Option<&'a [i8]>) -> Ordering

Compares self and other for ordering.

source§

impl<'a> CmpWrapper<Option<&'a [i16]>>

source

pub const fn const_eq(&self, other: &Option<&'a [i16]>) -> bool

Compares self and other for equality.

source§

impl<'a> CmpWrapper<Option<&'a [i16]>>

source

pub const fn const_cmp(&self, other: &Option<&'a [i16]>) -> Ordering

Compares self and other for ordering.

source§

impl<'a> CmpWrapper<Option<&'a [i32]>>

source

pub const fn const_eq(&self, other: &Option<&'a [i32]>) -> bool

Compares self and other for equality.

source§

impl<'a> CmpWrapper<Option<&'a [i32]>>

source

pub const fn const_cmp(&self, other: &Option<&'a [i32]>) -> Ordering

Compares self and other for ordering.

source§

impl<'a> CmpWrapper<Option<&'a [i64]>>

source

pub const fn const_eq(&self, other: &Option<&'a [i64]>) -> bool

Compares self and other for equality.

source§

impl<'a> CmpWrapper<Option<&'a [i64]>>

source

pub const fn const_cmp(&self, other: &Option<&'a [i64]>) -> Ordering

Compares self and other for ordering.

source§

impl<'a> CmpWrapper<Option<&'a [i128]>>

source

pub const fn const_eq(&self, other: &Option<&'a [i128]>) -> bool

Compares self and other for equality.

source§

impl<'a> CmpWrapper<Option<&'a [i128]>>

source

pub const fn const_cmp(&self, other: &Option<&'a [i128]>) -> Ordering

Compares self and other for ordering.

source§

impl<'a> CmpWrapper<Option<&'a [isize]>>

source

pub const fn const_eq(&self, other: &Option<&'a [isize]>) -> bool

Compares self and other for equality.

source§

impl<'a> CmpWrapper<Option<&'a [isize]>>

source

pub const fn const_cmp(&self, other: &Option<&'a [isize]>) -> Ordering

Compares self and other for ordering.

source§

impl<'a> CmpWrapper<Option<&'a [bool]>>

source

pub const fn const_eq(&self, other: &Option<&'a [bool]>) -> bool

Compares self and other for equality.

source§

impl<'a> CmpWrapper<Option<&'a [bool]>>

source

pub const fn const_cmp(&self, other: &Option<&'a [bool]>) -> Ordering

Compares self and other for ordering.

source§

impl<'a> CmpWrapper<Option<&'a [char]>>

source

pub const fn const_eq(&self, other: &Option<&'a [char]>) -> bool

Compares self and other for equality.

source§

impl<'a> CmpWrapper<Option<&'a [char]>>

source

pub const fn const_cmp(&self, other: &Option<&'a [char]>) -> Ordering

Compares self and other for ordering.

source§

impl<'a, 'b> CmpWrapper<Option<&'a [&'b str]>>

source

pub const fn const_eq(&self, other: &Option<&'a [&'b str]>) -> bool

Compares self and other for equality.

source§

impl<'a, 'b> CmpWrapper<Option<&'a [&'b str]>>

source

pub const fn const_cmp(&self, other: &Option<&'a [&'b str]>) -> Ordering

Compares self and other for ordering.

source§

impl<'a, 'b> CmpWrapper<Option<&'a [&'b [u8]]>>

source

pub const fn const_eq(&self, other: &Option<&'a [&'b [u8]]>) -> bool

Compares self and other for equality.

source§

impl<'a, 'b> CmpWrapper<Option<&'a [&'b [u8]]>>

source

pub const fn const_cmp(&self, other: &Option<&'a [&'b [u8]]>) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<&[u8]>

source

pub const fn const_eq(&self, other: &[u8]) -> bool

Compares self and other for equality.

source§

impl<'a> CmpWrapper<&[u8]>

source

pub const fn const_cmp(&self, other: &[u8]) -> Ordering

Compares self and other for ordering.

source§

impl<'a> CmpWrapper<Option<&'a [u8]>>

source

pub const fn const_eq(&self, other: &Option<&'a [u8]>) -> bool

Compares self and other for equality.

source§

impl<'a> CmpWrapper<Option<&'a [u8]>>

source

pub const fn const_cmp(&self, other: &Option<&'a [u8]>) -> Ordering

Compares self and other for ordering.

source§

impl CmpWrapper<&str>

source

pub const fn const_eq(&self, other: &str) -> bool

Compares self and other for equality.

source§

impl CmpWrapper<&str>

source

pub const fn const_cmp(&self, other: &str) -> Ordering

Compares self and other for ordering.

source§

impl<'a> CmpWrapper<Option<&'a str>>

source

pub const fn const_eq(&self, other: &Option<&'a str>) -> bool

Compares self and other for equality.

source§

impl<'a> CmpWrapper<Option<&'a str>>

source

pub const fn const_cmp(&self, other: &Option<&'a str>) -> Ordering

Compares self and other for ordering.

Trait Implementations§

source§

impl<T: Clone> Clone for CmpWrapper<T>

source§

fn clone(&self) -> CmpWrapper<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<P> ConstCmp for CmpWrapper<P>

§

type Kind = IsNotStdKind

What kind of type this is, this can be one of: Read more
source§

impl<T: Debug> Debug for CmpWrapper<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T: PartialEq> PartialEq for CmpWrapper<T>

source§

fn eq(&self, other: &CmpWrapper<T>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T: Copy> Copy for CmpWrapper<T>

source§

impl<T: Eq> Eq for CmpWrapper<T>

source§

impl<T> StructuralPartialEq for CmpWrapper<T>

Auto Trait Implementations§

§

impl<T> Freeze for CmpWrapper<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for CmpWrapper<T>
where T: RefUnwindSafe,

§

impl<T> Send for CmpWrapper<T>
where T: Send,

§

impl<T> Sync for CmpWrapper<T>
where T: Sync,

§

impl<T> Unpin for CmpWrapper<T>
where T: Unpin,

§

impl<T> UnwindSafe for CmpWrapper<T>
where T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, W> HasTypeWitness<W> for T
where W: MakeTypeWitness<Arg = T>, T: ?Sized,

source§

const WITNESS: W = W::MAKE

A constant of the type witness
source§

impl<T> Identity for T
where T: ?Sized,

§

type Type = T

The same type as Self, used to emulate type equality bounds (T == U) with associated type equality constraints (T: Identity<Type = U>).
source§

const TYPE_EQ: TypeEq<T, <T as Identity>::Type> = TypeEq::NEW

Proof that Self is the same type as Self::Type, provides methods for casting between Self and Self::Type.
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.