Struct IsAFormatMarker

Source
pub struct IsAFormatMarker<K, T: ?Sized, R: ?Sized>(/* private fields */);
Expand description

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.

R: a type that implements FormatMarker.

§Coerce Method

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

Implementations§

Source§

impl<R> IsAFormatMarker<R::Kind, R::This, R>
where R: ?Sized + FormatMarker,

Source

pub const NEW: Self

Constructs an IsAFormatMarker

Source§

impl<K, T: ?Sized, R: ?Sized> IsAFormatMarker<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<U, T: ?Sized, R: ?Sized> IsAFormatMarker<IsArrayKind<U>, T, R>

Source

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

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

Source§

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

Source

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

An identity function, just takes reference and returns it.

Source§

impl<T> IsAFormatMarker<IsStdKind, i8, T>

Source

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

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

Source§

impl<T> IsAFormatMarker<IsStdKind, u8, T>

Source

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

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

Source§

impl<T> IsAFormatMarker<IsStdKind, i16, T>

Source

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

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

Source§

impl<T> IsAFormatMarker<IsStdKind, u16, T>

Source

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

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

Source§

impl<T> IsAFormatMarker<IsStdKind, i32, T>

Source

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

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

Source§

impl<T> IsAFormatMarker<IsStdKind, u32, T>

Source

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

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

Source§

impl<T> IsAFormatMarker<IsStdKind, i64, T>

Source

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

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

Source§

impl<T> IsAFormatMarker<IsStdKind, u64, T>

Source

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

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

Source§

impl<T> IsAFormatMarker<IsStdKind, i128, T>

Source

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

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

Source§

impl<T> IsAFormatMarker<IsStdKind, u128, T>

Source

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

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

Source§

impl<T> IsAFormatMarker<IsStdKind, isize, T>

Source

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

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

Source§

impl<T> IsAFormatMarker<IsStdKind, usize, T>

Source

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

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

Source§

impl<T> IsAFormatMarker<IsStdKind, bool, T>

Source

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

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

Source§

impl<T> IsAFormatMarker<IsStdKind, char, T>

Source

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

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

Source§

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

Source

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

Wraps reference in a PWrapper.

Source§

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

Source

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

Source§

impl<T> IsAFormatMarker<IsStdKind, RangeFrom<usize>, T>

Source

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

Source§

impl<T> IsAFormatMarker<IsStdKind, RangeTo<usize>, T>

Source

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

Source§

impl<T> IsAFormatMarker<IsStdKind, RangeToInclusive<usize>, T>

Source

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

Source§

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

Source

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

Source§

impl<T> IsAFormatMarker<IsStdKind, RangeFull, T>

Source

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

Source§

impl<T, __T> IsAFormatMarker<IsStdKind, Option<NonNull<T>>, __T>

Source

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

Source§

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

Source

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

Source§

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

Source

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

Source§

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

Source

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

Source§

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

Source

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

Source§

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

Source

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

Source§

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

Source

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

Source§

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

Source

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

Source§

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

Source

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

Source§

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

Source

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

Source§

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

Source

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

Source§

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

Source

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

Source§

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

Source

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

Source§

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

Source

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

Source§

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

Source

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

Source§

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

Source

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

Source§

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

Source

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

Source§

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

Source

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

Source§

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

Source

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

Source§

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

Source

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

Source§

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

Source

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

Source§

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

Source

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

Source§

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

Source

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

Source§

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

Source

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

Source§

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

Source

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

Source§

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

Source

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

Source§

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

Source

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

Source§

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

Source

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

Source§

impl<__T> IsAFormatMarker<IsStdKind, NonZeroU8, __T>

Source

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

Source§

impl<__T> IsAFormatMarker<IsStdKind, NonZeroI8, __T>

Source

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

Source§

impl<__T> IsAFormatMarker<IsStdKind, NonZeroU16, __T>

Source

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

Source§

impl<__T> IsAFormatMarker<IsStdKind, NonZeroI16, __T>

Source

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

Source§

impl<__T> IsAFormatMarker<IsStdKind, NonZeroU32, __T>

Source

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

Source§

impl<__T> IsAFormatMarker<IsStdKind, NonZeroI32, __T>

Source

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

Source§

impl<__T> IsAFormatMarker<IsStdKind, NonZeroU64, __T>

Source

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

Source§

impl<__T> IsAFormatMarker<IsStdKind, NonZeroI64, __T>

Source

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

Source§

impl<__T> IsAFormatMarker<IsStdKind, NonZeroU128, __T>

Source

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

Source§

impl<__T> IsAFormatMarker<IsStdKind, NonZeroI128, __T>

Source

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

Source§

impl<__T> IsAFormatMarker<IsStdKind, NonZeroUsize, __T>

Source

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

Source§

impl<__T> IsAFormatMarker<IsStdKind, NonZeroIsize, __T>

Source

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

Source§

impl<T, __T> IsAFormatMarker<IsStdKind, *mut T, __T>

Source

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

Source§

impl<T, __T> IsAFormatMarker<IsStdKind, *const T, __T>

Source

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

Source§

impl<T, __T> IsAFormatMarker<IsStdKind, NonNull<T>, __T>

Source

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

Source§

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

Source

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

Source§

impl<__T> IsAFormatMarker<IsStdKind, PhantomPinned, __T>

Source

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

Source§

impl<__T> IsAFormatMarker<IsStdKind, (), __T>

Source

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

Source§

impl<__T> IsAFormatMarker<IsStdKind, Ordering, __T>

Source

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

Source§

impl<__T> IsAFormatMarker<IsStdKind, Ordering, __T>

Source

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

Trait Implementations§

Source§

impl<K, T: ?Sized, R: ?Sized> Clone for IsAFormatMarker<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 IsAFormatMarker<K, T, R>

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

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

§

impl<K, T, R> UnwindSafe for IsAFormatMarker<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> CloneToUninit for T
where T: Clone,

Source§

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

🔬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, 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>,

Source§

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>,

Source§

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.

Layout§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.

Size: 0 bytes