[][src]Struct const_format::marker_traits::IsAFormatMarker

pub struct IsAFormatMarker<K, T: ?Sized, R: ?Sized>(_);

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

Type parameters

K is <R as FormatMarker>::Kind The kind of type that T is, a slice, other std types, non-std types.

T is <R as FormatMarker>::This: The R type after removing all layers of references.

Coerce Method

The coerce method is what does the conversion from a &T depending on the K type parameter:

Implementations

impl<R: ?Sized> IsAFormatMarker<R::Kind, R::This, R> where
    R: FormatMarker
[src]

pub const NEW: Self[src]

Constructs an IsAFormatMarker

impl<K, T: ?Sized, R: ?Sized> IsAFormatMarker<K, T, R>[src]

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

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.

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

Removes layers of references by coercing the argument.

impl<U, T: ?Sized, R: ?Sized> IsAFormatMarker<IsArrayKind<U>, T, R>[src]

pub const fn coerce(self, slice: &[U]) -> PWrapper<&[U]>[src]

Coerces an array to a slice, then wraps the slice in a PWrapper

impl<T: ?Sized, R: ?Sized> IsAFormatMarker<IsNotStdKind, T, R>[src]

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

An identity function, just takes reference and returns it.

impl<T> IsAFormatMarker<IsStdKind, i8, T>[src]

pub const fn coerce(self, reference: &i8) -> PWrapper<i8>[src]

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

impl<T> IsAFormatMarker<IsStdKind, u8, T>[src]

pub const fn coerce(self, reference: &u8) -> PWrapper<u8>[src]

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

impl<T> IsAFormatMarker<IsStdKind, i16, T>[src]

pub const fn coerce(self, reference: &i16) -> PWrapper<i16>[src]

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

impl<T> IsAFormatMarker<IsStdKind, u16, T>[src]

pub const fn coerce(self, reference: &u16) -> PWrapper<u16>[src]

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

impl<T> IsAFormatMarker<IsStdKind, i32, T>[src]

pub const fn coerce(self, reference: &i32) -> PWrapper<i32>[src]

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

impl<T> IsAFormatMarker<IsStdKind, u32, T>[src]

pub const fn coerce(self, reference: &u32) -> PWrapper<u32>[src]

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

impl<T> IsAFormatMarker<IsStdKind, i64, T>[src]

pub const fn coerce(self, reference: &i64) -> PWrapper<i64>[src]

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

impl<T> IsAFormatMarker<IsStdKind, u64, T>[src]

pub const fn coerce(self, reference: &u64) -> PWrapper<u64>[src]

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

impl<T> IsAFormatMarker<IsStdKind, i128, T>[src]

pub const fn coerce(self, reference: &i128) -> PWrapper<i128>[src]

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

impl<T> IsAFormatMarker<IsStdKind, u128, T>[src]

pub const fn coerce(self, reference: &u128) -> PWrapper<u128>[src]

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

impl<T> IsAFormatMarker<IsStdKind, isize, T>[src]

pub const fn coerce(self, reference: &isize) -> PWrapper<isize>[src]

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

impl<T> IsAFormatMarker<IsStdKind, usize, T>[src]

pub const fn coerce(self, reference: &usize) -> PWrapper<usize>[src]

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

impl<T> IsAFormatMarker<IsStdKind, bool, T>[src]

pub const fn coerce(self, reference: &bool) -> PWrapper<bool>[src]

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

impl<R: ?Sized> IsAFormatMarker<IsStdKind, str, R>[src]

pub const fn coerce(self, reference: &str) -> PWrapper<&str>[src]

Wraps reference in a PWrapper.

impl<T> IsAFormatMarker<IsStdKind, Range<usize>, T>[src]

pub const fn coerce(self, range: &Range<usize>) -> PWrapper<Range<usize>>[src]

impl<T> IsAFormatMarker<IsStdKind, RangeFrom<usize>, T>[src]

pub const fn coerce(
    self,
    range: &RangeFrom<usize>
) -> PWrapper<RangeFrom<usize>>
[src]

impl<T> IsAFormatMarker<IsStdKind, RangeTo<usize>, T>[src]

pub const fn coerce(self, range: &RangeTo<usize>) -> PWrapper<RangeTo<usize>>[src]

impl<T> IsAFormatMarker<IsStdKind, RangeToInclusive<usize>, T>[src]

pub const fn coerce(
    self,
    range: &RangeToInclusive<usize>
) -> PWrapper<RangeToInclusive<usize>>
[src]

impl<T> IsAFormatMarker<IsStdKind, RangeInclusive<usize>, T>[src]

pub const fn coerce(
    self,
    range: &RangeInclusive<usize>
) -> PWrapper<RangeInclusive<usize>>
[src]

impl<T> IsAFormatMarker<IsStdKind, RangeFull, T>[src]

pub const fn coerce(self, _: &RangeFull) -> PWrapper<RangeFull>[src]

impl<T, __T> IsAFormatMarker<IsStdKind, Option<NonNull<T>>, __T>[src]

pub const fn coerce(
    self,
    reference: &Option<NonNull<T>>
) -> PWrapper<Option<NonNull<T>>>
[src]

impl<__T> IsAFormatMarker<IsStdKind, Option<NonZeroU8>, __T>[src]

pub const fn coerce(
    self,
    reference: &Option<NonZeroU8>
) -> PWrapper<Option<NonZeroU8>>
[src]

impl<__T> IsAFormatMarker<IsStdKind, Option<NonZeroI8>, __T>[src]

pub const fn coerce(
    self,
    reference: &Option<NonZeroI8>
) -> PWrapper<Option<NonZeroI8>>
[src]

impl<__T> IsAFormatMarker<IsStdKind, Option<NonZeroU16>, __T>[src]

pub const fn coerce(
    self,
    reference: &Option<NonZeroU16>
) -> PWrapper<Option<NonZeroU16>>
[src]

impl<__T> IsAFormatMarker<IsStdKind, Option<NonZeroI16>, __T>[src]

pub const fn coerce(
    self,
    reference: &Option<NonZeroI16>
) -> PWrapper<Option<NonZeroI16>>
[src]

impl<__T> IsAFormatMarker<IsStdKind, Option<NonZeroU32>, __T>[src]

pub const fn coerce(
    self,
    reference: &Option<NonZeroU32>
) -> PWrapper<Option<NonZeroU32>>
[src]

impl<__T> IsAFormatMarker<IsStdKind, Option<NonZeroI32>, __T>[src]

pub const fn coerce(
    self,
    reference: &Option<NonZeroI32>
) -> PWrapper<Option<NonZeroI32>>
[src]

impl<__T> IsAFormatMarker<IsStdKind, Option<NonZeroU64>, __T>[src]

pub const fn coerce(
    self,
    reference: &Option<NonZeroU64>
) -> PWrapper<Option<NonZeroU64>>
[src]

impl<__T> IsAFormatMarker<IsStdKind, Option<NonZeroI64>, __T>[src]

pub const fn coerce(
    self,
    reference: &Option<NonZeroI64>
) -> PWrapper<Option<NonZeroI64>>
[src]

impl<__T> IsAFormatMarker<IsStdKind, Option<NonZeroU128>, __T>[src]

pub const fn coerce(
    self,
    reference: &Option<NonZeroU128>
) -> PWrapper<Option<NonZeroU128>>
[src]

impl<__T> IsAFormatMarker<IsStdKind, Option<NonZeroI128>, __T>[src]

pub const fn coerce(
    self,
    reference: &Option<NonZeroI128>
) -> PWrapper<Option<NonZeroI128>>
[src]

impl<__T> IsAFormatMarker<IsStdKind, Option<NonZeroUsize>, __T>[src]

pub const fn coerce(
    self,
    reference: &Option<NonZeroUsize>
) -> PWrapper<Option<NonZeroUsize>>
[src]

impl<__T> IsAFormatMarker<IsStdKind, Option<NonZeroIsize>, __T>[src]

pub const fn coerce(
    self,
    reference: &Option<NonZeroIsize>
) -> PWrapper<Option<NonZeroIsize>>
[src]

impl<__T> IsAFormatMarker<IsStdKind, Option<u8>, __T>[src]

pub const fn coerce(self, reference: &Option<u8>) -> PWrapper<Option<u8>>[src]

impl<__T> IsAFormatMarker<IsStdKind, Option<i8>, __T>[src]

pub const fn coerce(self, reference: &Option<i8>) -> PWrapper<Option<i8>>[src]

impl<__T> IsAFormatMarker<IsStdKind, Option<u16>, __T>[src]

pub const fn coerce(self, reference: &Option<u16>) -> PWrapper<Option<u16>>[src]

impl<__T> IsAFormatMarker<IsStdKind, Option<i16>, __T>[src]

pub const fn coerce(self, reference: &Option<i16>) -> PWrapper<Option<i16>>[src]

impl<__T> IsAFormatMarker<IsStdKind, Option<u32>, __T>[src]

pub const fn coerce(self, reference: &Option<u32>) -> PWrapper<Option<u32>>[src]

impl<__T> IsAFormatMarker<IsStdKind, Option<i32>, __T>[src]

pub const fn coerce(self, reference: &Option<i32>) -> PWrapper<Option<i32>>[src]

impl<__T> IsAFormatMarker<IsStdKind, Option<u64>, __T>[src]

pub const fn coerce(self, reference: &Option<u64>) -> PWrapper<Option<u64>>[src]

impl<__T> IsAFormatMarker<IsStdKind, Option<i64>, __T>[src]

pub const fn coerce(self, reference: &Option<i64>) -> PWrapper<Option<i64>>[src]

impl<__T> IsAFormatMarker<IsStdKind, Option<u128>, __T>[src]

pub const fn coerce(self, reference: &Option<u128>) -> PWrapper<Option<u128>>[src]

impl<__T> IsAFormatMarker<IsStdKind, Option<i128>, __T>[src]

pub const fn coerce(self, reference: &Option<i128>) -> PWrapper<Option<i128>>[src]

impl<__T> IsAFormatMarker<IsStdKind, Option<usize>, __T>[src]

pub const fn coerce(self, reference: &Option<usize>) -> PWrapper<Option<usize>>[src]

impl<__T> IsAFormatMarker<IsStdKind, Option<isize>, __T>[src]

pub const fn coerce(self, reference: &Option<isize>) -> PWrapper<Option<isize>>[src]

impl<__T> IsAFormatMarker<IsStdKind, Option<bool>, __T>[src]

pub const fn coerce(self, reference: &Option<bool>) -> PWrapper<Option<bool>>[src]

impl<'a, __T> IsAFormatMarker<IsStdKind, Option<&'a str>, __T>[src]

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

impl<__T> IsAFormatMarker<IsStdKind, NonZeroU8, __T>[src]

pub const fn coerce(self, reference: &NonZeroU8) -> PWrapper<NonZeroU8>[src]

impl<__T> IsAFormatMarker<IsStdKind, NonZeroI8, __T>[src]

pub const fn coerce(self, reference: &NonZeroI8) -> PWrapper<NonZeroI8>[src]

impl<__T> IsAFormatMarker<IsStdKind, NonZeroU16, __T>[src]

pub const fn coerce(self, reference: &NonZeroU16) -> PWrapper<NonZeroU16>[src]

impl<__T> IsAFormatMarker<IsStdKind, NonZeroI16, __T>[src]

pub const fn coerce(self, reference: &NonZeroI16) -> PWrapper<NonZeroI16>[src]

impl<__T> IsAFormatMarker<IsStdKind, NonZeroU32, __T>[src]

pub const fn coerce(self, reference: &NonZeroU32) -> PWrapper<NonZeroU32>[src]

impl<__T> IsAFormatMarker<IsStdKind, NonZeroI32, __T>[src]

pub const fn coerce(self, reference: &NonZeroI32) -> PWrapper<NonZeroI32>[src]

impl<__T> IsAFormatMarker<IsStdKind, NonZeroU64, __T>[src]

pub const fn coerce(self, reference: &NonZeroU64) -> PWrapper<NonZeroU64>[src]

impl<__T> IsAFormatMarker<IsStdKind, NonZeroI64, __T>[src]

pub const fn coerce(self, reference: &NonZeroI64) -> PWrapper<NonZeroI64>[src]

impl<__T> IsAFormatMarker<IsStdKind, NonZeroU128, __T>[src]

pub const fn coerce(self, reference: &NonZeroU128) -> PWrapper<NonZeroU128>[src]

impl<__T> IsAFormatMarker<IsStdKind, NonZeroI128, __T>[src]

pub const fn coerce(self, reference: &NonZeroI128) -> PWrapper<NonZeroI128>[src]

impl<__T> IsAFormatMarker<IsStdKind, NonZeroUsize, __T>[src]

pub const fn coerce(self, reference: &NonZeroUsize) -> PWrapper<NonZeroUsize>[src]

impl<__T> IsAFormatMarker<IsStdKind, NonZeroIsize, __T>[src]

pub const fn coerce(self, reference: &NonZeroIsize) -> PWrapper<NonZeroIsize>[src]

impl<T, __T> IsAFormatMarker<IsStdKind, *mut T, __T>[src]

pub const fn coerce(self, reference: &*mut T) -> PWrapper<*mut T>[src]

impl<T, __T> IsAFormatMarker<IsStdKind, *const T, __T>[src]

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

impl<T, __T> IsAFormatMarker<IsStdKind, NonNull<T>, __T>[src]

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

impl<T: ?Sized, __T> IsAFormatMarker<IsStdKind, PhantomData<T>, __T>[src]

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

impl<__T> IsAFormatMarker<IsStdKind, PhantomPinned, __T>[src]

pub const fn coerce(self, reference: &PhantomPinned) -> PWrapper<PhantomPinned>[src]

impl<__T> IsAFormatMarker<IsStdKind, (), __T>[src]

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

impl<__T> IsAFormatMarker<IsStdKind, AtomicOrdering, __T>[src]

pub const fn coerce(
    self,
    reference: &AtomicOrdering
) -> PWrapper<AtomicOrdering>
[src]

impl<__T> IsAFormatMarker<IsStdKind, Ordering, __T>[src]

pub const fn coerce(self, reference: &Ordering) -> PWrapper<Ordering>[src]

Trait Implementations

impl<K, T: ?Sized, R: ?Sized> Clone for IsAFormatMarker<K, T, R>[src]

impl<K, T: ?Sized, R: ?Sized> Copy for IsAFormatMarker<K, T, R>[src]

Auto Trait Implementations

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

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

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

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

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

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.