Struct konst::cmp::IsAConstCmp
source · pub struct IsAConstCmp<K, T: ?Sized, R: ?Sized>(/* private fields */);
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>
impl<T> IsAConstCmp<IsStdKind, i8, T>
sourcepub const fn coerce(self, reference: &i8) -> CmpWrapper<i8>
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>
impl<T> IsAConstCmp<IsStdKind, u8, T>
sourcepub const fn coerce(self, reference: &u8) -> CmpWrapper<u8>
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>
impl<T> IsAConstCmp<IsStdKind, i16, T>
sourcepub const fn coerce(self, reference: &i16) -> CmpWrapper<i16>
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>
impl<T> IsAConstCmp<IsStdKind, u16, T>
sourcepub const fn coerce(self, reference: &u16) -> CmpWrapper<u16>
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>
impl<T> IsAConstCmp<IsStdKind, i32, T>
sourcepub const fn coerce(self, reference: &i32) -> CmpWrapper<i32>
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>
impl<T> IsAConstCmp<IsStdKind, u32, T>
sourcepub const fn coerce(self, reference: &u32) -> CmpWrapper<u32>
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>
impl<T> IsAConstCmp<IsStdKind, i64, T>
sourcepub const fn coerce(self, reference: &i64) -> CmpWrapper<i64>
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>
impl<T> IsAConstCmp<IsStdKind, u64, T>
sourcepub const fn coerce(self, reference: &u64) -> CmpWrapper<u64>
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>
impl<T> IsAConstCmp<IsStdKind, i128, T>
sourcepub const fn coerce(self, reference: &i128) -> CmpWrapper<i128>
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>
impl<T> IsAConstCmp<IsStdKind, u128, T>
sourcepub const fn coerce(self, reference: &u128) -> CmpWrapper<u128>
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>
impl<T> IsAConstCmp<IsStdKind, isize, T>
sourcepub const fn coerce(self, reference: &isize) -> CmpWrapper<isize>
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>
impl<T> IsAConstCmp<IsStdKind, usize, T>
sourcepub const fn coerce(self, reference: &usize) -> CmpWrapper<usize>
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>
impl<T> IsAConstCmp<IsStdKind, bool, T>
sourcepub const fn coerce(self, reference: &bool) -> CmpWrapper<bool>
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>
impl<T> IsAConstCmp<IsStdKind, char, T>
sourcepub const fn coerce(self, reference: &char) -> CmpWrapper<char>
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>
impl<R, T> IsAConstCmp<T::Kind, T, R>
source§impl<K, T: ?Sized, R: ?Sized> IsAConstCmp<K, T, R>
impl<K, T: ?Sized, R: ?Sized> IsAConstCmp<K, T, R>
sourcepub const fn infer_type(self, _: &R) -> Self
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.
sourcepub const fn unreference(self, r: &T) -> &T
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>
impl<T: ?Sized, R: ?Sized> IsAConstCmp<IsNotStdKind, T, R>
source§impl<R: ?Sized> IsAConstCmp<IsStdKind, str, R>
impl<R: ?Sized> IsAConstCmp<IsStdKind, str, R>
sourcepub const fn coerce(self, reference: &str) -> CmpWrapper<&str>
pub const fn coerce(self, reference: &str) -> CmpWrapper<&str>
Wraps reference
in a CmpWrapper
.
source§impl<T, R: ?Sized> IsAConstCmp<IsStdKind, [T], R>
impl<T, R: ?Sized> IsAConstCmp<IsStdKind, [T], R>
sourcepub const fn coerce(self, reference: &[T]) -> CmpWrapper<&[T]>
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>
impl<T, R, const N: usize> IsAConstCmp<IsStdKind, [T; N], R>
sourcepub const fn coerce(self, reference: &[T; N]) -> CmpWrapper<&[T]>
pub const fn coerce(self, reference: &[T; N]) -> CmpWrapper<&[T]>
Wraps reference
in a CmpWrapper
.
source§impl<T> IsAConstCmp<IsStdKind, RangeInclusive<u8>, T>
impl<T> IsAConstCmp<IsStdKind, RangeInclusive<u8>, T>
sourcepub const fn coerce(
self,
range: &RangeInclusive<u8>,
) -> CmpWrapper<RangeInclusive<u8>>
pub const fn coerce( self, range: &RangeInclusive<u8>, ) -> CmpWrapper<RangeInclusive<u8>>
source§impl<T> IsAConstCmp<IsStdKind, RangeInclusive<u16>, T>
impl<T> IsAConstCmp<IsStdKind, RangeInclusive<u16>, T>
sourcepub const fn coerce(
self,
range: &RangeInclusive<u16>,
) -> CmpWrapper<RangeInclusive<u16>>
pub const fn coerce( self, range: &RangeInclusive<u16>, ) -> CmpWrapper<RangeInclusive<u16>>
source§impl<T> IsAConstCmp<IsStdKind, RangeInclusive<u32>, T>
impl<T> IsAConstCmp<IsStdKind, RangeInclusive<u32>, T>
sourcepub const fn coerce(
self,
range: &RangeInclusive<u32>,
) -> CmpWrapper<RangeInclusive<u32>>
pub const fn coerce( self, range: &RangeInclusive<u32>, ) -> CmpWrapper<RangeInclusive<u32>>
source§impl<T> IsAConstCmp<IsStdKind, RangeInclusive<u64>, T>
impl<T> IsAConstCmp<IsStdKind, RangeInclusive<u64>, T>
sourcepub const fn coerce(
self,
range: &RangeInclusive<u64>,
) -> CmpWrapper<RangeInclusive<u64>>
pub const fn coerce( self, range: &RangeInclusive<u64>, ) -> CmpWrapper<RangeInclusive<u64>>
source§impl<T> IsAConstCmp<IsStdKind, RangeInclusive<u128>, T>
impl<T> IsAConstCmp<IsStdKind, RangeInclusive<u128>, T>
sourcepub const fn coerce(
self,
range: &RangeInclusive<u128>,
) -> CmpWrapper<RangeInclusive<u128>>
pub const fn coerce( self, range: &RangeInclusive<u128>, ) -> CmpWrapper<RangeInclusive<u128>>
source§impl<T> IsAConstCmp<IsStdKind, RangeInclusive<usize>, T>
impl<T> IsAConstCmp<IsStdKind, RangeInclusive<usize>, T>
sourcepub const fn coerce(
self,
range: &RangeInclusive<usize>,
) -> CmpWrapper<RangeInclusive<usize>>
pub const fn coerce( self, range: &RangeInclusive<usize>, ) -> CmpWrapper<RangeInclusive<usize>>
source§impl<T> IsAConstCmp<IsStdKind, RangeInclusive<char>, T>
impl<T> IsAConstCmp<IsStdKind, RangeInclusive<char>, T>
sourcepub const fn coerce(
self,
range: &RangeInclusive<char>,
) -> CmpWrapper<RangeInclusive<char>>
pub const fn coerce( self, range: &RangeInclusive<char>, ) -> CmpWrapper<RangeInclusive<char>>
source§impl<__T> IsAConstCmp<IsStdKind, NonZeroU8, __T>
impl<__T> IsAConstCmp<IsStdKind, NonZeroU8, __T>
sourcepub const fn coerce(self, reference: &NonZeroU8) -> CmpWrapper<NonZeroU8>
pub const fn coerce(self, reference: &NonZeroU8) -> CmpWrapper<NonZeroU8>
source§impl<__T> IsAConstCmp<IsStdKind, NonZeroI8, __T>
impl<__T> IsAConstCmp<IsStdKind, NonZeroI8, __T>
sourcepub const fn coerce(self, reference: &NonZeroI8) -> CmpWrapper<NonZeroI8>
pub const fn coerce(self, reference: &NonZeroI8) -> CmpWrapper<NonZeroI8>
source§impl<__T> IsAConstCmp<IsStdKind, NonZeroU16, __T>
impl<__T> IsAConstCmp<IsStdKind, NonZeroU16, __T>
sourcepub const fn coerce(self, reference: &NonZeroU16) -> CmpWrapper<NonZeroU16>
pub const fn coerce(self, reference: &NonZeroU16) -> CmpWrapper<NonZeroU16>
source§impl<__T> IsAConstCmp<IsStdKind, NonZeroI16, __T>
impl<__T> IsAConstCmp<IsStdKind, NonZeroI16, __T>
sourcepub const fn coerce(self, reference: &NonZeroI16) -> CmpWrapper<NonZeroI16>
pub const fn coerce(self, reference: &NonZeroI16) -> CmpWrapper<NonZeroI16>
source§impl<__T> IsAConstCmp<IsStdKind, NonZeroU32, __T>
impl<__T> IsAConstCmp<IsStdKind, NonZeroU32, __T>
sourcepub const fn coerce(self, reference: &NonZeroU32) -> CmpWrapper<NonZeroU32>
pub const fn coerce(self, reference: &NonZeroU32) -> CmpWrapper<NonZeroU32>
source§impl<__T> IsAConstCmp<IsStdKind, NonZeroI32, __T>
impl<__T> IsAConstCmp<IsStdKind, NonZeroI32, __T>
sourcepub const fn coerce(self, reference: &NonZeroI32) -> CmpWrapper<NonZeroI32>
pub const fn coerce(self, reference: &NonZeroI32) -> CmpWrapper<NonZeroI32>
source§impl<__T> IsAConstCmp<IsStdKind, NonZeroU64, __T>
impl<__T> IsAConstCmp<IsStdKind, NonZeroU64, __T>
sourcepub const fn coerce(self, reference: &NonZeroU64) -> CmpWrapper<NonZeroU64>
pub const fn coerce(self, reference: &NonZeroU64) -> CmpWrapper<NonZeroU64>
source§impl<__T> IsAConstCmp<IsStdKind, NonZeroI64, __T>
impl<__T> IsAConstCmp<IsStdKind, NonZeroI64, __T>
sourcepub const fn coerce(self, reference: &NonZeroI64) -> CmpWrapper<NonZeroI64>
pub const fn coerce(self, reference: &NonZeroI64) -> CmpWrapper<NonZeroI64>
source§impl<__T> IsAConstCmp<IsStdKind, NonZeroU128, __T>
impl<__T> IsAConstCmp<IsStdKind, NonZeroU128, __T>
sourcepub const fn coerce(self, reference: &NonZeroU128) -> CmpWrapper<NonZeroU128>
pub const fn coerce(self, reference: &NonZeroU128) -> CmpWrapper<NonZeroU128>
source§impl<__T> IsAConstCmp<IsStdKind, NonZeroI128, __T>
impl<__T> IsAConstCmp<IsStdKind, NonZeroI128, __T>
sourcepub const fn coerce(self, reference: &NonZeroI128) -> CmpWrapper<NonZeroI128>
pub const fn coerce(self, reference: &NonZeroI128) -> CmpWrapper<NonZeroI128>
source§impl<__T> IsAConstCmp<IsStdKind, NonZeroUsize, __T>
impl<__T> IsAConstCmp<IsStdKind, NonZeroUsize, __T>
sourcepub const fn coerce(self, reference: &NonZeroUsize) -> CmpWrapper<NonZeroUsize>
pub const fn coerce(self, reference: &NonZeroUsize) -> CmpWrapper<NonZeroUsize>
source§impl<__T> IsAConstCmp<IsStdKind, NonZeroIsize, __T>
impl<__T> IsAConstCmp<IsStdKind, NonZeroIsize, __T>
sourcepub const fn coerce(self, reference: &NonZeroIsize) -> CmpWrapper<NonZeroIsize>
pub const fn coerce(self, reference: &NonZeroIsize) -> CmpWrapper<NonZeroIsize>
source§impl<__T> IsAConstCmp<IsStdKind, Option<NonZeroU16>, __T>
impl<__T> IsAConstCmp<IsStdKind, Option<NonZeroU16>, __T>
sourcepub const fn coerce(
self,
reference: &Option<NonZeroU16>,
) -> CmpWrapper<Option<NonZeroU16>>
pub const fn coerce( self, reference: &Option<NonZeroU16>, ) -> CmpWrapper<Option<NonZeroU16>>
source§impl<__T> IsAConstCmp<IsStdKind, Option<NonZeroI16>, __T>
impl<__T> IsAConstCmp<IsStdKind, Option<NonZeroI16>, __T>
sourcepub const fn coerce(
self,
reference: &Option<NonZeroI16>,
) -> CmpWrapper<Option<NonZeroI16>>
pub const fn coerce( self, reference: &Option<NonZeroI16>, ) -> CmpWrapper<Option<NonZeroI16>>
source§impl<__T> IsAConstCmp<IsStdKind, Option<NonZeroU32>, __T>
impl<__T> IsAConstCmp<IsStdKind, Option<NonZeroU32>, __T>
sourcepub const fn coerce(
self,
reference: &Option<NonZeroU32>,
) -> CmpWrapper<Option<NonZeroU32>>
pub const fn coerce( self, reference: &Option<NonZeroU32>, ) -> CmpWrapper<Option<NonZeroU32>>
source§impl<__T> IsAConstCmp<IsStdKind, Option<NonZeroI32>, __T>
impl<__T> IsAConstCmp<IsStdKind, Option<NonZeroI32>, __T>
sourcepub const fn coerce(
self,
reference: &Option<NonZeroI32>,
) -> CmpWrapper<Option<NonZeroI32>>
pub const fn coerce( self, reference: &Option<NonZeroI32>, ) -> CmpWrapper<Option<NonZeroI32>>
source§impl<__T> IsAConstCmp<IsStdKind, Option<NonZeroU64>, __T>
impl<__T> IsAConstCmp<IsStdKind, Option<NonZeroU64>, __T>
sourcepub const fn coerce(
self,
reference: &Option<NonZeroU64>,
) -> CmpWrapper<Option<NonZeroU64>>
pub const fn coerce( self, reference: &Option<NonZeroU64>, ) -> CmpWrapper<Option<NonZeroU64>>
source§impl<__T> IsAConstCmp<IsStdKind, Option<NonZeroI64>, __T>
impl<__T> IsAConstCmp<IsStdKind, Option<NonZeroI64>, __T>
sourcepub const fn coerce(
self,
reference: &Option<NonZeroI64>,
) -> CmpWrapper<Option<NonZeroI64>>
pub const fn coerce( self, reference: &Option<NonZeroI64>, ) -> CmpWrapper<Option<NonZeroI64>>
source§impl<__T> IsAConstCmp<IsStdKind, Option<NonZeroU128>, __T>
impl<__T> IsAConstCmp<IsStdKind, Option<NonZeroU128>, __T>
sourcepub const fn coerce(
self,
reference: &Option<NonZeroU128>,
) -> CmpWrapper<Option<NonZeroU128>>
pub const fn coerce( self, reference: &Option<NonZeroU128>, ) -> CmpWrapper<Option<NonZeroU128>>
source§impl<__T> IsAConstCmp<IsStdKind, Option<NonZeroI128>, __T>
impl<__T> IsAConstCmp<IsStdKind, Option<NonZeroI128>, __T>
sourcepub const fn coerce(
self,
reference: &Option<NonZeroI128>,
) -> CmpWrapper<Option<NonZeroI128>>
pub const fn coerce( self, reference: &Option<NonZeroI128>, ) -> CmpWrapper<Option<NonZeroI128>>
source§impl<__T> IsAConstCmp<IsStdKind, Option<NonZeroUsize>, __T>
impl<__T> IsAConstCmp<IsStdKind, Option<NonZeroUsize>, __T>
sourcepub const fn coerce(
self,
reference: &Option<NonZeroUsize>,
) -> CmpWrapper<Option<NonZeroUsize>>
pub const fn coerce( self, reference: &Option<NonZeroUsize>, ) -> CmpWrapper<Option<NonZeroUsize>>
source§impl<__T> IsAConstCmp<IsStdKind, Option<NonZeroIsize>, __T>
impl<__T> IsAConstCmp<IsStdKind, Option<NonZeroIsize>, __T>
sourcepub const fn coerce(
self,
reference: &Option<NonZeroIsize>,
) -> CmpWrapper<Option<NonZeroIsize>>
pub const fn coerce( self, reference: &Option<NonZeroIsize>, ) -> CmpWrapper<Option<NonZeroIsize>>
source§impl<__T> IsAConstCmp<IsStdKind, Ordering, __T>
impl<__T> IsAConstCmp<IsStdKind, Ordering, __T>
sourcepub const fn coerce(self, reference: &Ordering) -> CmpWrapper<Ordering>
pub const fn coerce(self, reference: &Ordering) -> CmpWrapper<Ordering>
source§impl<T, __T> IsAConstCmp<IsStdKind, PhantomData<T>, __T>
impl<T, __T> IsAConstCmp<IsStdKind, PhantomData<T>, __T>
sourcepub const fn coerce(
self,
reference: &PhantomData<T>,
) -> CmpWrapper<PhantomData<T>>
pub const fn coerce( self, reference: &PhantomData<T>, ) -> CmpWrapper<PhantomData<T>>
source§impl<__T> IsAConstCmp<IsStdKind, PhantomPinned, __T>
impl<__T> IsAConstCmp<IsStdKind, PhantomPinned, __T>
sourcepub const fn coerce(
self,
reference: &PhantomPinned,
) -> CmpWrapper<PhantomPinned>
pub const fn coerce( self, reference: &PhantomPinned, ) -> CmpWrapper<PhantomPinned>
Trait Implementations§
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>
impl<K, T, R> RefUnwindSafe for IsAConstCmp<K, T, R>
impl<K, T, R> Send for IsAConstCmp<K, T, R>
impl<K, T, R> Sync for IsAConstCmp<K, T, R>
impl<K, T, R> Unpin for IsAConstCmp<K, T, R>
impl<K, T, R> UnwindSafe for IsAConstCmp<K, T, R>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)