Struct konst::cmp::IsAConstCmp

source ·
pub struct IsAConstCmp<K, T: ?Sized, R: ?Sized>(/* private fields */);
Available on crate feature cmp only.
Expand description

Hack used to automatically wrap standard library types inside CmpWrapper, while leaving user defined types unwrapped.

This can be constructed with he NEW associated constant

§Type parameters

K is <T as ConstCmp>::Kind The kind of type that T is: either IsStdKind or IsNotStdKind.

T is <R as ConstCmpUnref>::This, the R type after removing all layers of references.

R: Is a type that implements ConstCmp

Implementations§

source§

impl<T> IsAConstCmp<IsStdKind, i8, T>

source

pub const fn coerce(self, reference: &i8) -> CmpWrapper<i8>

Copies the value from reference, and wraps it in a CmpWrapper

source§

impl<T> IsAConstCmp<IsStdKind, u8, T>

source

pub const fn coerce(self, reference: &u8) -> CmpWrapper<u8>

Copies the value from reference, and wraps it in a CmpWrapper

source§

impl<T> IsAConstCmp<IsStdKind, i16, T>

source

pub const fn coerce(self, reference: &i16) -> CmpWrapper<i16>

Copies the value from reference, and wraps it in a CmpWrapper

source§

impl<T> IsAConstCmp<IsStdKind, u16, T>

source

pub const fn coerce(self, reference: &u16) -> CmpWrapper<u16>

Copies the value from reference, and wraps it in a CmpWrapper

source§

impl<T> IsAConstCmp<IsStdKind, i32, T>

source

pub const fn coerce(self, reference: &i32) -> CmpWrapper<i32>

Copies the value from reference, and wraps it in a CmpWrapper

source§

impl<T> IsAConstCmp<IsStdKind, u32, T>

source

pub const fn coerce(self, reference: &u32) -> CmpWrapper<u32>

Copies the value from reference, and wraps it in a CmpWrapper

source§

impl<T> IsAConstCmp<IsStdKind, i64, T>

source

pub const fn coerce(self, reference: &i64) -> CmpWrapper<i64>

Copies the value from reference, and wraps it in a CmpWrapper

source§

impl<T> IsAConstCmp<IsStdKind, u64, T>

source

pub const fn coerce(self, reference: &u64) -> CmpWrapper<u64>

Copies the value from reference, and wraps it in a CmpWrapper

source§

impl<T> IsAConstCmp<IsStdKind, i128, T>

source

pub const fn coerce(self, reference: &i128) -> CmpWrapper<i128>

Copies the value from reference, and wraps it in a CmpWrapper

source§

impl<T> IsAConstCmp<IsStdKind, u128, T>

source

pub const fn coerce(self, reference: &u128) -> CmpWrapper<u128>

Copies the value from reference, and wraps it in a CmpWrapper

source§

impl<T> IsAConstCmp<IsStdKind, isize, T>

source

pub const fn coerce(self, reference: &isize) -> CmpWrapper<isize>

Copies the value from reference, and wraps it in a CmpWrapper

source§

impl<T> IsAConstCmp<IsStdKind, usize, T>

source

pub const fn coerce(self, reference: &usize) -> CmpWrapper<usize>

Copies the value from reference, and wraps it in a CmpWrapper

source§

impl<T> IsAConstCmp<IsStdKind, bool, T>

source

pub const fn coerce(self, reference: &bool) -> CmpWrapper<bool>

Copies the value from reference, and wraps it in a CmpWrapper

source§

impl<T> IsAConstCmp<IsStdKind, char, T>

source

pub const fn coerce(self, reference: &char) -> CmpWrapper<char>

Copies the value from reference, and wraps it in a CmpWrapper

source§

impl<R, T> IsAConstCmp<T::Kind, T, R>
where R: ?Sized + ConstCmpUnref<This = T>, T: ?Sized + ConstCmp,

source

pub const NEW: Self = _

Constructs an IsAConstCmp

source§

impl<K, T: ?Sized, R: ?Sized> IsAConstCmp<K, T, R>

source

pub const fn infer_type(self, _: &R) -> Self

Infers the type parameters by taking a reference to R .

The K and T type parameters are determined by R in the NEW associated constant.

source

pub const fn unreference(self, r: &T) -> &T

Removes layers of references by coercing the argument.

source§

impl<T: ?Sized, R: ?Sized> IsAConstCmp<IsNotStdKind, T, R>

source

pub const fn coerce(self, reference: &T) -> &T

An identity function, just takes reference and returns it.

source§

impl<R: ?Sized> IsAConstCmp<IsStdKind, str, R>

source

pub const fn coerce(self, reference: &str) -> CmpWrapper<&str>

Wraps reference in a CmpWrapper.

source§

impl<T, R: ?Sized> IsAConstCmp<IsStdKind, [T], R>

source

pub const fn coerce(self, reference: &[T]) -> CmpWrapper<&[T]>

Wraps reference in a CmpWrapper.

source§

impl<T, R, const N: usize> IsAConstCmp<IsStdKind, [T; N], R>

source

pub const fn coerce(self, reference: &[T; N]) -> CmpWrapper<&[T]>

Wraps reference in a CmpWrapper.

source§

impl<__T> IsAConstCmp<IsStdKind, Option<u8>, __T>

source

pub const fn coerce(self, reference: &Option<u8>) -> CmpWrapper<Option<u8>>

source§

impl<__T> IsAConstCmp<IsStdKind, Option<i8>, __T>

source

pub const fn coerce(self, reference: &Option<i8>) -> CmpWrapper<Option<i8>>

source§

impl<__T> IsAConstCmp<IsStdKind, Option<u16>, __T>

source

pub const fn coerce(self, reference: &Option<u16>) -> CmpWrapper<Option<u16>>

source§

impl<__T> IsAConstCmp<IsStdKind, Option<i16>, __T>

source

pub const fn coerce(self, reference: &Option<i16>) -> CmpWrapper<Option<i16>>

source§

impl<__T> IsAConstCmp<IsStdKind, Option<u32>, __T>

source

pub const fn coerce(self, reference: &Option<u32>) -> CmpWrapper<Option<u32>>

source§

impl<__T> IsAConstCmp<IsStdKind, Option<i32>, __T>

source

pub const fn coerce(self, reference: &Option<i32>) -> CmpWrapper<Option<i32>>

source§

impl<__T> IsAConstCmp<IsStdKind, Option<u64>, __T>

source

pub const fn coerce(self, reference: &Option<u64>) -> CmpWrapper<Option<u64>>

source§

impl<__T> IsAConstCmp<IsStdKind, Option<i64>, __T>

source

pub const fn coerce(self, reference: &Option<i64>) -> CmpWrapper<Option<i64>>

source§

impl<__T> IsAConstCmp<IsStdKind, Option<u128>, __T>

source

pub const fn coerce(self, reference: &Option<u128>) -> CmpWrapper<Option<u128>>

source§

impl<__T> IsAConstCmp<IsStdKind, Option<i128>, __T>

source

pub const fn coerce(self, reference: &Option<i128>) -> CmpWrapper<Option<i128>>

source§

impl<__T> IsAConstCmp<IsStdKind, Option<usize>, __T>

source

pub const fn coerce( self, reference: &Option<usize> ) -> CmpWrapper<Option<usize>>

source§

impl<__T> IsAConstCmp<IsStdKind, Option<isize>, __T>

source

pub const fn coerce( self, reference: &Option<isize> ) -> CmpWrapper<Option<isize>>

source§

impl<__T> IsAConstCmp<IsStdKind, Option<bool>, __T>

source

pub const fn coerce(self, reference: &Option<bool>) -> CmpWrapper<Option<bool>>

source§

impl<__T> IsAConstCmp<IsStdKind, Option<char>, __T>

source

pub const fn coerce(self, reference: &Option<char>) -> CmpWrapper<Option<char>>

source§

impl<T> IsAConstCmp<IsStdKind, Range<u8>, T>

source

pub const fn coerce(self, range: &Range<u8>) -> CmpWrapper<Range<u8>>

source§

impl<T> IsAConstCmp<IsStdKind, Range<u16>, T>

source

pub const fn coerce(self, range: &Range<u16>) -> CmpWrapper<Range<u16>>

source§

impl<T> IsAConstCmp<IsStdKind, Range<u32>, T>

source

pub const fn coerce(self, range: &Range<u32>) -> CmpWrapper<Range<u32>>

source§

impl<T> IsAConstCmp<IsStdKind, Range<u64>, T>

source

pub const fn coerce(self, range: &Range<u64>) -> CmpWrapper<Range<u64>>

source§

impl<T> IsAConstCmp<IsStdKind, Range<u128>, T>

source

pub const fn coerce(self, range: &Range<u128>) -> CmpWrapper<Range<u128>>

source§

impl<T> IsAConstCmp<IsStdKind, Range<usize>, T>

source

pub const fn coerce(self, range: &Range<usize>) -> CmpWrapper<Range<usize>>

source§

impl<T> IsAConstCmp<IsStdKind, Range<char>, T>

source

pub const fn coerce(self, range: &Range<char>) -> CmpWrapper<Range<char>>

source§

impl<T> IsAConstCmp<IsStdKind, RangeInclusive<u8>, T>

source

pub const fn coerce( self, range: &RangeInclusive<u8> ) -> CmpWrapper<RangeInclusive<u8>>

source§

impl<T> IsAConstCmp<IsStdKind, RangeInclusive<u16>, T>

source

pub const fn coerce( self, range: &RangeInclusive<u16> ) -> CmpWrapper<RangeInclusive<u16>>

source§

impl<T> IsAConstCmp<IsStdKind, RangeInclusive<u32>, T>

source

pub const fn coerce( self, range: &RangeInclusive<u32> ) -> CmpWrapper<RangeInclusive<u32>>

source§

impl<T> IsAConstCmp<IsStdKind, RangeInclusive<u64>, T>

source

pub const fn coerce( self, range: &RangeInclusive<u64> ) -> CmpWrapper<RangeInclusive<u64>>

source§

impl<T> IsAConstCmp<IsStdKind, RangeInclusive<u128>, T>

source

pub const fn coerce( self, range: &RangeInclusive<u128> ) -> CmpWrapper<RangeInclusive<u128>>

source§

impl<T> IsAConstCmp<IsStdKind, RangeInclusive<usize>, T>

source

pub const fn coerce( self, range: &RangeInclusive<usize> ) -> CmpWrapper<RangeInclusive<usize>>

source§

impl<T> IsAConstCmp<IsStdKind, RangeInclusive<char>, T>

source

pub const fn coerce( self, range: &RangeInclusive<char> ) -> CmpWrapper<RangeInclusive<char>>

source§

impl<__T> IsAConstCmp<IsStdKind, NonZeroU8, __T>

source

pub const fn coerce(self, reference: &NonZeroU8) -> CmpWrapper<NonZeroU8>

source§

impl<__T> IsAConstCmp<IsStdKind, NonZeroI8, __T>

source

pub const fn coerce(self, reference: &NonZeroI8) -> CmpWrapper<NonZeroI8>

source§

impl<__T> IsAConstCmp<IsStdKind, NonZeroU16, __T>

source

pub const fn coerce(self, reference: &NonZeroU16) -> CmpWrapper<NonZeroU16>

source§

impl<__T> IsAConstCmp<IsStdKind, NonZeroI16, __T>

source

pub const fn coerce(self, reference: &NonZeroI16) -> CmpWrapper<NonZeroI16>

source§

impl<__T> IsAConstCmp<IsStdKind, NonZeroU32, __T>

source

pub const fn coerce(self, reference: &NonZeroU32) -> CmpWrapper<NonZeroU32>

source§

impl<__T> IsAConstCmp<IsStdKind, NonZeroI32, __T>

source

pub const fn coerce(self, reference: &NonZeroI32) -> CmpWrapper<NonZeroI32>

source§

impl<__T> IsAConstCmp<IsStdKind, NonZeroU64, __T>

source

pub const fn coerce(self, reference: &NonZeroU64) -> CmpWrapper<NonZeroU64>

source§

impl<__T> IsAConstCmp<IsStdKind, NonZeroI64, __T>

source

pub const fn coerce(self, reference: &NonZeroI64) -> CmpWrapper<NonZeroI64>

source§

impl<__T> IsAConstCmp<IsStdKind, NonZeroU128, __T>

source

pub const fn coerce(self, reference: &NonZeroU128) -> CmpWrapper<NonZeroU128>

source§

impl<__T> IsAConstCmp<IsStdKind, NonZeroI128, __T>

source

pub const fn coerce(self, reference: &NonZeroI128) -> CmpWrapper<NonZeroI128>

source§

impl<__T> IsAConstCmp<IsStdKind, NonZeroUsize, __T>

source

pub const fn coerce(self, reference: &NonZeroUsize) -> CmpWrapper<NonZeroUsize>

source§

impl<__T> IsAConstCmp<IsStdKind, NonZeroIsize, __T>

source

pub const fn coerce(self, reference: &NonZeroIsize) -> CmpWrapper<NonZeroIsize>

source§

impl<__T> IsAConstCmp<IsStdKind, Option<NonZeroU8>, __T>

source

pub const fn coerce( self, reference: &Option<NonZeroU8> ) -> CmpWrapper<Option<NonZeroU8>>

source§

impl<__T> IsAConstCmp<IsStdKind, Option<NonZeroI8>, __T>

source

pub const fn coerce( self, reference: &Option<NonZeroI8> ) -> CmpWrapper<Option<NonZeroI8>>

source§

impl<__T> IsAConstCmp<IsStdKind, Option<NonZeroU16>, __T>

source

pub const fn coerce( self, reference: &Option<NonZeroU16> ) -> CmpWrapper<Option<NonZeroU16>>

source§

impl<__T> IsAConstCmp<IsStdKind, Option<NonZeroI16>, __T>

source

pub const fn coerce( self, reference: &Option<NonZeroI16> ) -> CmpWrapper<Option<NonZeroI16>>

source§

impl<__T> IsAConstCmp<IsStdKind, Option<NonZeroU32>, __T>

source

pub const fn coerce( self, reference: &Option<NonZeroU32> ) -> CmpWrapper<Option<NonZeroU32>>

source§

impl<__T> IsAConstCmp<IsStdKind, Option<NonZeroI32>, __T>

source

pub const fn coerce( self, reference: &Option<NonZeroI32> ) -> CmpWrapper<Option<NonZeroI32>>

source§

impl<__T> IsAConstCmp<IsStdKind, Option<NonZeroU64>, __T>

source

pub const fn coerce( self, reference: &Option<NonZeroU64> ) -> CmpWrapper<Option<NonZeroU64>>

source§

impl<__T> IsAConstCmp<IsStdKind, Option<NonZeroI64>, __T>

source

pub const fn coerce( self, reference: &Option<NonZeroI64> ) -> CmpWrapper<Option<NonZeroI64>>

source§

impl<__T> IsAConstCmp<IsStdKind, Option<NonZeroU128>, __T>

source

pub const fn coerce( self, reference: &Option<NonZeroU128> ) -> CmpWrapper<Option<NonZeroU128>>

source§

impl<__T> IsAConstCmp<IsStdKind, Option<NonZeroI128>, __T>

source

pub const fn coerce( self, reference: &Option<NonZeroI128> ) -> CmpWrapper<Option<NonZeroI128>>

source§

impl<__T> IsAConstCmp<IsStdKind, Option<NonZeroUsize>, __T>

source

pub const fn coerce( self, reference: &Option<NonZeroUsize> ) -> CmpWrapper<Option<NonZeroUsize>>

source§

impl<__T> IsAConstCmp<IsStdKind, Option<NonZeroIsize>, __T>

source

pub const fn coerce( self, reference: &Option<NonZeroIsize> ) -> CmpWrapper<Option<NonZeroIsize>>

source§

impl<__T> IsAConstCmp<IsStdKind, Ordering, __T>

source

pub const fn coerce(self, reference: &Ordering) -> CmpWrapper<Ordering>

source§

impl<__T> IsAConstCmp<IsStdKind, Option<Ordering>, __T>

source

pub const fn coerce( self, reference: &Option<Ordering> ) -> CmpWrapper<Option<Ordering>>

source§

impl<T, __T> IsAConstCmp<IsStdKind, PhantomData<T>, __T>

source

pub const fn coerce( self, reference: &PhantomData<T> ) -> CmpWrapper<PhantomData<T>>

source§

impl<__T> IsAConstCmp<IsStdKind, PhantomPinned, __T>

source

pub const fn coerce( self, reference: &PhantomPinned ) -> CmpWrapper<PhantomPinned>

source§

impl<'a, __T> IsAConstCmp<IsStdKind, Option<&'a [u16]>, __T>

source

pub const fn coerce( self, reference: &Option<&'a [u16]> ) -> CmpWrapper<Option<&'a [u16]>>

source§

impl<'a, __T> IsAConstCmp<IsStdKind, Option<&'a [u32]>, __T>

source

pub const fn coerce( self, reference: &Option<&'a [u32]> ) -> CmpWrapper<Option<&'a [u32]>>

source§

impl<'a, __T> IsAConstCmp<IsStdKind, Option<&'a [u64]>, __T>

source

pub const fn coerce( self, reference: &Option<&'a [u64]> ) -> CmpWrapper<Option<&'a [u64]>>

source§

impl<'a, __T> IsAConstCmp<IsStdKind, Option<&'a [u128]>, __T>

source

pub const fn coerce( self, reference: &Option<&'a [u128]> ) -> CmpWrapper<Option<&'a [u128]>>

source§

impl<'a, __T> IsAConstCmp<IsStdKind, Option<&'a [usize]>, __T>

source

pub const fn coerce( self, reference: &Option<&'a [usize]> ) -> CmpWrapper<Option<&'a [usize]>>

source§

impl<'a, __T> IsAConstCmp<IsStdKind, Option<&'a [i8]>, __T>

source

pub const fn coerce( self, reference: &Option<&'a [i8]> ) -> CmpWrapper<Option<&'a [i8]>>

source§

impl<'a, __T> IsAConstCmp<IsStdKind, Option<&'a [i16]>, __T>

source

pub const fn coerce( self, reference: &Option<&'a [i16]> ) -> CmpWrapper<Option<&'a [i16]>>

source§

impl<'a, __T> IsAConstCmp<IsStdKind, Option<&'a [i32]>, __T>

source

pub const fn coerce( self, reference: &Option<&'a [i32]> ) -> CmpWrapper<Option<&'a [i32]>>

source§

impl<'a, __T> IsAConstCmp<IsStdKind, Option<&'a [i64]>, __T>

source

pub const fn coerce( self, reference: &Option<&'a [i64]> ) -> CmpWrapper<Option<&'a [i64]>>

source§

impl<'a, __T> IsAConstCmp<IsStdKind, Option<&'a [i128]>, __T>

source

pub const fn coerce( self, reference: &Option<&'a [i128]> ) -> CmpWrapper<Option<&'a [i128]>>

source§

impl<'a, __T> IsAConstCmp<IsStdKind, Option<&'a [isize]>, __T>

source

pub const fn coerce( self, reference: &Option<&'a [isize]> ) -> CmpWrapper<Option<&'a [isize]>>

source§

impl<'a, __T> IsAConstCmp<IsStdKind, Option<&'a [bool]>, __T>

source

pub const fn coerce( self, reference: &Option<&'a [bool]> ) -> CmpWrapper<Option<&'a [bool]>>

source§

impl<'a, __T> IsAConstCmp<IsStdKind, Option<&'a [char]>, __T>

source

pub const fn coerce( self, reference: &Option<&'a [char]> ) -> CmpWrapper<Option<&'a [char]>>

source§

impl<'a, 'b, __T> IsAConstCmp<IsStdKind, Option<&'a [&'b str]>, __T>

source

pub const fn coerce( self, reference: &Option<&'a [&'b str]> ) -> CmpWrapper<Option<&'a [&'b str]>>

source§

impl<'a, 'b, __T> IsAConstCmp<IsStdKind, Option<&'a [&'b [u8]]>, __T>

source

pub const fn coerce( self, reference: &Option<&'a [&'b [u8]]> ) -> CmpWrapper<Option<&'a [&'b [u8]]>>

source§

impl<'a, __T> IsAConstCmp<IsStdKind, Option<&'a [u8]>, __T>

source

pub const fn coerce( self, reference: &Option<&'a [u8]> ) -> CmpWrapper<Option<&'a [u8]>>

source§

impl<'a, __T> IsAConstCmp<IsStdKind, Option<&'a str>, __T>

source

pub const fn coerce( self, reference: &Option<&'a str> ) -> CmpWrapper<Option<&'a str>>

Trait Implementations§

source§

impl<K, T: ?Sized, R: ?Sized> Clone for IsAConstCmp<K, T, R>

source§

fn clone(&self) -> Self

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<K, T: ?Sized, R: ?Sized> Copy for IsAConstCmp<K, T, R>

Auto Trait Implementations§

§

impl<K, T, R> Freeze for IsAConstCmp<K, T, R>
where T: ?Sized, R: ?Sized,

§

impl<K, T, R> RefUnwindSafe for IsAConstCmp<K, T, R>
where T: ?Sized, R: ?Sized,

§

impl<K, T, R> Send for IsAConstCmp<K, T, R>
where T: ?Sized, R: ?Sized,

§

impl<K, T, R> Sync for IsAConstCmp<K, T, R>
where T: ?Sized, R: ?Sized,

§

impl<K, T, R> Unpin for IsAConstCmp<K, T, R>
where T: ?Sized, R: ?Sized,

§

impl<K, T, R> UnwindSafe for IsAConstCmp<K, T, R>
where T: ?Sized, R: ?Sized,

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> 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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.