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
.