[][src]Struct const_format::PWrapper

pub struct PWrapper<T>(pub T);
This is supported on crate feature fmt only.

Wrapper for many std types, which implements the const_debug_fmt and/or const_display_fmt methods for them.

The macros from this crate automatically wraps std types in this type, so you only need to use it if you're manually calling the const_*_fmt methods.

Constructors

Most std types can be wrapped in this type simply by doing PWrapper(value).

To wrap arrays, there is the PWrapper::slice constructor for convenience.

Excluded std types

Note that this type does not implement the formatting methods for all std types, it can't implement them for std types which wrap non-std types, and for Options/arrays/slices it only does it with integer, and &str type parameters.

You can use the call_debug_fmt macro to format arrays/slices/Options of any type that can be const debug formatted.

Example

This example demonstrates how you can implement debug formatting for a type using PWrapper to write std types.

#![feature(const_mut_refs)]

use const_format::{Error, Formatter, PWrapper};
use const_format::{impl_fmt, formatc, try_};

use core::num::NonZeroU32;

pub struct Divide(pub u32, pub u32);

impl_fmt!{
    impl Divide;
     
    pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error> {
        let Self(left, right) = *self;
        let divided = self.0 / self.1;

        let mut f = f.debug_struct("Divide");
        try_!(PWrapper(self.0).const_debug_fmt(f.field("numerator")));
        try_!(PWrapper(self.1).const_debug_fmt(f.field("denominator")));
        try_!(PWrapper(divided).const_debug_fmt(f.field("divided")));
        f.finish()
    }
}

const TEXT: &str = formatc!("{:?}", Divide(34, 11));
const T_HEX: &str = formatc!("{:x?}", Divide(34, 11));
const T_BIN: &str = formatc!("{:b?}", Divide(34, 11));

assert_eq!(TEXT, "Divide { numerator: 34, denominator: 11, divided: 3 }");
assert_eq!(T_HEX, "Divide { numerator: 22, denominator: B, divided: 3 }");
assert_eq!(T_BIN, "Divide { numerator: 100010, denominator: 1011, divided: 11 }");

Implementations

impl PWrapper<&[&str]>[src]

pub const fn const_eq(&self, other: &[&str]) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<&[bool]>[src]

pub const fn const_eq(&self, other: &[bool]) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<&[u8]>[src]

pub const fn const_eq(&self, other: &[u8]) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<&[i8]>[src]

pub const fn const_eq(&self, other: &[i8]) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<&[u16]>[src]

pub const fn const_eq(&self, other: &[u16]) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<&[i16]>[src]

pub const fn const_eq(&self, other: &[i16]) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<&[u32]>[src]

pub const fn const_eq(&self, other: &[u32]) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<&[i32]>[src]

pub const fn const_eq(&self, other: &[i32]) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<&[u64]>[src]

pub const fn const_eq(&self, other: &[u64]) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<&[i64]>[src]

pub const fn const_eq(&self, other: &[i64]) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<&[u128]>[src]

pub const fn const_eq(&self, other: &[u128]) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<&[i128]>[src]

pub const fn const_eq(&self, other: &[i128]) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<&[usize]>[src]

pub const fn const_eq(&self, other: &[usize]) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<&[isize]>[src]

pub const fn const_eq(&self, other: &[isize]) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<NonZeroU8>[src]

pub const fn const_eq(&self, r: &NonZeroU8) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<Option<NonZeroU8>>[src]

pub const fn const_eq(&self, other: &Option<NonZeroU8>) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<NonZeroI8>[src]

pub const fn const_eq(&self, r: &NonZeroI8) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<Option<NonZeroI8>>[src]

pub const fn const_eq(&self, other: &Option<NonZeroI8>) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<NonZeroU16>[src]

pub const fn const_eq(&self, r: &NonZeroU16) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<Option<NonZeroU16>>[src]

pub const fn const_eq(&self, other: &Option<NonZeroU16>) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<NonZeroI16>[src]

pub const fn const_eq(&self, r: &NonZeroI16) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<Option<NonZeroI16>>[src]

pub const fn const_eq(&self, other: &Option<NonZeroI16>) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<NonZeroU32>[src]

pub const fn const_eq(&self, r: &NonZeroU32) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<Option<NonZeroU32>>[src]

pub const fn const_eq(&self, other: &Option<NonZeroU32>) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<NonZeroI32>[src]

pub const fn const_eq(&self, r: &NonZeroI32) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<Option<NonZeroI32>>[src]

pub const fn const_eq(&self, other: &Option<NonZeroI32>) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<NonZeroU64>[src]

pub const fn const_eq(&self, r: &NonZeroU64) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<Option<NonZeroU64>>[src]

pub const fn const_eq(&self, other: &Option<NonZeroU64>) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<NonZeroI64>[src]

pub const fn const_eq(&self, r: &NonZeroI64) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<Option<NonZeroI64>>[src]

pub const fn const_eq(&self, other: &Option<NonZeroI64>) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<NonZeroU128>[src]

pub const fn const_eq(&self, r: &NonZeroU128) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<Option<NonZeroU128>>[src]

pub const fn const_eq(&self, other: &Option<NonZeroU128>) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<NonZeroI128>[src]

pub const fn const_eq(&self, r: &NonZeroI128) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<Option<NonZeroI128>>[src]

pub const fn const_eq(&self, other: &Option<NonZeroI128>) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<NonZeroUsize>[src]

pub const fn const_eq(&self, r: &NonZeroUsize) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<Option<NonZeroUsize>>[src]

pub const fn const_eq(&self, other: &Option<NonZeroUsize>) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<NonZeroIsize>[src]

pub const fn const_eq(&self, r: &NonZeroIsize) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<Option<NonZeroIsize>>[src]

pub const fn const_eq(&self, other: &Option<NonZeroIsize>) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<u8>[src]

pub const fn const_eq(&self, r: &u8) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<Option<u8>>[src]

pub const fn const_eq(&self, other: &Option<u8>) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<i8>[src]

pub const fn const_eq(&self, r: &i8) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<Option<i8>>[src]

pub const fn const_eq(&self, other: &Option<i8>) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<u16>[src]

pub const fn const_eq(&self, r: &u16) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<Option<u16>>[src]

pub const fn const_eq(&self, other: &Option<u16>) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<i16>[src]

pub const fn const_eq(&self, r: &i16) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<Option<i16>>[src]

pub const fn const_eq(&self, other: &Option<i16>) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<u32>[src]

pub const fn const_eq(&self, r: &u32) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<Option<u32>>[src]

pub const fn const_eq(&self, other: &Option<u32>) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<i32>[src]

pub const fn const_eq(&self, r: &i32) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<Option<i32>>[src]

pub const fn const_eq(&self, other: &Option<i32>) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<u64>[src]

pub const fn const_eq(&self, r: &u64) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<Option<u64>>[src]

pub const fn const_eq(&self, other: &Option<u64>) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<i64>[src]

pub const fn const_eq(&self, r: &i64) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<Option<i64>>[src]

pub const fn const_eq(&self, other: &Option<i64>) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<u128>[src]

pub const fn const_eq(&self, r: &u128) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<Option<u128>>[src]

pub const fn const_eq(&self, other: &Option<u128>) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<i128>[src]

pub const fn const_eq(&self, r: &i128) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<Option<i128>>[src]

pub const fn const_eq(&self, other: &Option<i128>) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<usize>[src]

pub const fn const_eq(&self, r: &usize) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<Option<usize>>[src]

pub const fn const_eq(&self, other: &Option<usize>) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<isize>[src]

pub const fn const_eq(&self, r: &isize) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<Option<isize>>[src]

pub const fn const_eq(&self, other: &Option<isize>) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<bool>[src]

pub const fn const_eq(&self, r: &bool) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<Option<bool>>[src]

pub const fn const_eq(&self, other: &Option<bool>) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<&str>[src]

pub const fn const_eq(&self, r: &&str) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<Option<&str>>[src]

pub const fn const_eq(&self, other: &Option<&str>) -> bool[src]

This method is only available with the "assert" feature.

impl<T: ?Sized> PWrapper<PhantomData<T>>[src]

pub const fn const_eq(&self, r: &PhantomData<T>) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<PhantomPinned>[src]

pub const fn const_eq(&self, r: &PhantomPinned) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<()>[src]

pub const fn const_eq(&self, r: &()) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<Ordering>[src]

pub const fn const_eq(&self, r: &Ordering) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<AtomicOrdering>[src]

pub const fn const_eq(&self, r: &AtomicOrdering) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<Range<usize>>[src]

pub const fn const_eq(&self, r: &Range<usize>) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<RangeInclusive<usize>>[src]

pub const fn const_eq(&self, r: &RangeInclusive<usize>) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<RangeFrom<usize>>[src]

pub const fn const_eq(&self, r: &RangeFrom<usize>) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<RangeFull>[src]

pub const fn const_eq(&self, r: &RangeFull) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<RangeTo<usize>>[src]

pub const fn const_eq(&self, r: &RangeTo<usize>) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<RangeToInclusive<usize>>[src]

pub const fn const_eq(&self, r: &RangeToInclusive<usize>) -> bool[src]

This method is only available with the "assert" feature.

impl PWrapper<Range<usize>>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

impl PWrapper<RangeFrom<usize>>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

impl PWrapper<RangeTo<usize>>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

impl PWrapper<RangeToInclusive<usize>>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

impl PWrapper<RangeInclusive<usize>>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

impl PWrapper<RangeFull>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

impl PWrapper<&str>[src]

pub const fn const_display_fmt(
    &self,
    f: &mut Formatter<'_>
) -> Result<(), Error>
[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

impl PWrapper<bool>[src]

pub const fn const_display_fmt(
    &self,
    f: &mut Formatter<'_>
) -> Result<(), Error>
[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

impl PWrapper<&[&str]>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

impl PWrapper<&[bool]>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

impl PWrapper<&[u8]>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

impl PWrapper<&[i8]>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

impl PWrapper<&[u16]>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

impl PWrapper<&[i16]>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

impl PWrapper<&[u32]>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

impl PWrapper<&[i32]>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

impl PWrapper<&[u64]>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

impl PWrapper<&[i64]>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

impl PWrapper<&[u128]>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

impl PWrapper<&[i128]>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

impl PWrapper<&[usize]>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

impl PWrapper<&[isize]>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

impl<T> PWrapper<Option<NonNull<T>>>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

impl PWrapper<Option<NonZeroU8>>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

impl PWrapper<Option<NonZeroI8>>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

impl PWrapper<Option<NonZeroU16>>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

impl PWrapper<Option<NonZeroI16>>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

impl PWrapper<Option<NonZeroU32>>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

impl PWrapper<Option<NonZeroI32>>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

impl PWrapper<Option<NonZeroU64>>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

impl PWrapper<Option<NonZeroI64>>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

impl PWrapper<Option<NonZeroU128>>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

impl PWrapper<Option<NonZeroI128>>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

impl PWrapper<Option<NonZeroUsize>>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

impl PWrapper<Option<NonZeroIsize>>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

impl PWrapper<Option<u8>>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

impl PWrapper<Option<i8>>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

impl PWrapper<Option<u16>>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

impl PWrapper<Option<i16>>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

impl PWrapper<Option<u32>>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

impl PWrapper<Option<i32>>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

impl PWrapper<Option<u64>>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

impl PWrapper<Option<i64>>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

impl PWrapper<Option<u128>>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

impl PWrapper<Option<i128>>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

impl PWrapper<Option<usize>>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

impl PWrapper<Option<isize>>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

impl PWrapper<Option<bool>>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

impl<'a> PWrapper<Option<&'a str>>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

impl PWrapper<NonZeroU8>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

pub const fn const_display_fmt(
    &self,
    f: &mut Formatter<'_>
) -> Result<(), Error>
[src]

impl PWrapper<NonZeroI8>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

pub const fn const_display_fmt(
    &self,
    f: &mut Formatter<'_>
) -> Result<(), Error>
[src]

impl PWrapper<NonZeroU16>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

pub const fn const_display_fmt(
    &self,
    f: &mut Formatter<'_>
) -> Result<(), Error>
[src]

impl PWrapper<NonZeroI16>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

pub const fn const_display_fmt(
    &self,
    f: &mut Formatter<'_>
) -> Result<(), Error>
[src]

impl PWrapper<NonZeroU32>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

pub const fn const_display_fmt(
    &self,
    f: &mut Formatter<'_>
) -> Result<(), Error>
[src]

impl PWrapper<NonZeroI32>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

pub const fn const_display_fmt(
    &self,
    f: &mut Formatter<'_>
) -> Result<(), Error>
[src]

impl PWrapper<NonZeroU64>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

pub const fn const_display_fmt(
    &self,
    f: &mut Formatter<'_>
) -> Result<(), Error>
[src]

impl PWrapper<NonZeroI64>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

pub const fn const_display_fmt(
    &self,
    f: &mut Formatter<'_>
) -> Result<(), Error>
[src]

impl PWrapper<NonZeroU128>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

pub const fn const_display_fmt(
    &self,
    f: &mut Formatter<'_>
) -> Result<(), Error>
[src]

impl PWrapper<NonZeroI128>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

pub const fn const_display_fmt(
    &self,
    f: &mut Formatter<'_>
) -> Result<(), Error>
[src]

impl PWrapper<NonZeroUsize>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

pub const fn const_display_fmt(
    &self,
    f: &mut Formatter<'_>
) -> Result<(), Error>
[src]

impl PWrapper<NonZeroIsize>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

pub const fn const_display_fmt(
    &self,
    f: &mut Formatter<'_>
) -> Result<(), Error>
[src]

impl<T> PWrapper<*mut T>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

impl<T> PWrapper<*const T>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

impl<T> PWrapper<NonNull<T>>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

impl<T: ?Sized> PWrapper<PhantomData<T>>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

impl PWrapper<PhantomPinned>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

impl PWrapper<()>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

impl PWrapper<AtomicOrdering>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

impl PWrapper<Ordering>[src]

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

impl PWrapper<u8>[src]

pub const fn const_display_fmt(
    &self,
    f: &mut Formatter<'_>
) -> Result<(), Error>
[src]

Writes a u8 with Display formatting.

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

Writes a u8 with Debug formatting.

impl PWrapper<u16>[src]

pub const fn const_display_fmt(
    &self,
    f: &mut Formatter<'_>
) -> Result<(), Error>
[src]

Writes a u16 with Display formatting.

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

Writes a u16 with Debug formatting.

impl PWrapper<u32>[src]

pub const fn const_display_fmt(
    &self,
    f: &mut Formatter<'_>
) -> Result<(), Error>
[src]

Writes a u32 with Display formatting.

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

Writes a u32 with Debug formatting.

impl PWrapper<u64>[src]

pub const fn const_display_fmt(
    &self,
    f: &mut Formatter<'_>
) -> Result<(), Error>
[src]

Writes a u64 with Display formatting.

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

Writes a u64 with Debug formatting.

impl PWrapper<u128>[src]

pub const fn const_display_fmt(
    &self,
    f: &mut Formatter<'_>
) -> Result<(), Error>
[src]

Writes a u128 with Display formatting.

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

Writes a u128 with Debug formatting.

impl PWrapper<usize>[src]

pub const fn const_display_fmt(
    &self,
    f: &mut Formatter<'_>
) -> Result<(), Error>
[src]

Writes a usize with Display formatting.

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

Writes a usize with Debug formatting.

impl PWrapper<i8>[src]

pub const fn const_display_fmt(
    &self,
    f: &mut Formatter<'_>
) -> Result<(), Error>
[src]

Writes a i8 with Display formatting.

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

Writes a i8 with Debug formatting.

impl PWrapper<i16>[src]

pub const fn const_display_fmt(
    &self,
    f: &mut Formatter<'_>
) -> Result<(), Error>
[src]

Writes a i16 with Display formatting.

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

Writes a i16 with Debug formatting.

impl PWrapper<i32>[src]

pub const fn const_display_fmt(
    &self,
    f: &mut Formatter<'_>
) -> Result<(), Error>
[src]

Writes a i32 with Display formatting.

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

Writes a i32 with Debug formatting.

impl PWrapper<i64>[src]

pub const fn const_display_fmt(
    &self,
    f: &mut Formatter<'_>
) -> Result<(), Error>
[src]

Writes a i64 with Display formatting.

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

Writes a i64 with Debug formatting.

impl PWrapper<i128>[src]

pub const fn const_display_fmt(
    &self,
    f: &mut Formatter<'_>
) -> Result<(), Error>
[src]

Writes a i128 with Display formatting.

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

Writes a i128 with Debug formatting.

impl PWrapper<isize>[src]

pub const fn const_display_fmt(
    &self,
    f: &mut Formatter<'_>
) -> Result<(), Error>
[src]

Writes a isize with Display formatting.

pub const fn const_debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

Writes a isize with Debug formatting.

impl<'a, T> PWrapper<&'a [T]>[src]

pub const fn slice(x: &'a [T]) -> Self[src]

For constructing from a reference to an array.

With slices you can do PWrapper(slice) as well.

impl PWrapper<i8>[src]

pub const fn hexadecimal_len(self, fmt: FormattingFlags) -> usize[src]

Computes how long much space is necessary to write this integer as a hexadecimal literal.

pub const fn binary_len(self, fmt: FormattingFlags) -> usize[src]

Computes how long much space is necessary to write this integer as a binary literal.

impl PWrapper<i8>[src]

pub const fn unsigned_abs(self) -> u8[src]

Returns the absolute value of this integer, as the equivalent unsigned type.

impl PWrapper<i16>[src]

pub const fn hexadecimal_len(self, fmt: FormattingFlags) -> usize[src]

Computes how long much space is necessary to write this integer as a hexadecimal literal.

pub const fn binary_len(self, fmt: FormattingFlags) -> usize[src]

Computes how long much space is necessary to write this integer as a binary literal.

impl PWrapper<i16>[src]

pub const fn unsigned_abs(self) -> u16[src]

Returns the absolute value of this integer, as the equivalent unsigned type.

impl PWrapper<i32>[src]

pub const fn hexadecimal_len(self, fmt: FormattingFlags) -> usize[src]

Computes how long much space is necessary to write this integer as a hexadecimal literal.

pub const fn binary_len(self, fmt: FormattingFlags) -> usize[src]

Computes how long much space is necessary to write this integer as a binary literal.

impl PWrapper<i32>[src]

pub const fn unsigned_abs(self) -> u32[src]

Returns the absolute value of this integer, as the equivalent unsigned type.

impl PWrapper<i64>[src]

pub const fn hexadecimal_len(self, fmt: FormattingFlags) -> usize[src]

Computes how long much space is necessary to write this integer as a hexadecimal literal.

pub const fn binary_len(self, fmt: FormattingFlags) -> usize[src]

Computes how long much space is necessary to write this integer as a binary literal.

impl PWrapper<i64>[src]

pub const fn unsigned_abs(self) -> u64[src]

Returns the absolute value of this integer, as the equivalent unsigned type.

impl PWrapper<i128>[src]

pub const fn hexadecimal_len(self, fmt: FormattingFlags) -> usize[src]

Computes how long much space is necessary to write this integer as a hexadecimal literal.

pub const fn binary_len(self, fmt: FormattingFlags) -> usize[src]

Computes how long much space is necessary to write this integer as a binary literal.

impl PWrapper<i128>[src]

pub const fn unsigned_abs(self) -> u128[src]

Returns the absolute value of this integer, as the equivalent unsigned type.

impl PWrapper<u8>[src]

pub const fn hexadecimal_len(self, fmt: FormattingFlags) -> usize[src]

Computes how long much space is necessary to write this integer as a hexadecimal literal.

pub const fn binary_len(self, fmt: FormattingFlags) -> usize[src]

Computes how long much space is necessary to write this integer as a binary literal.

impl PWrapper<u8>[src]

pub const fn unsigned_abs(self) -> u8[src]

Returns the absolute value of this integer, as the equivalent unsigned type.

impl PWrapper<u16>[src]

pub const fn hexadecimal_len(self, fmt: FormattingFlags) -> usize[src]

Computes how long much space is necessary to write this integer as a hexadecimal literal.

pub const fn binary_len(self, fmt: FormattingFlags) -> usize[src]

Computes how long much space is necessary to write this integer as a binary literal.

impl PWrapper<u16>[src]

pub const fn unsigned_abs(self) -> u16[src]

Returns the absolute value of this integer, as the equivalent unsigned type.

impl PWrapper<u32>[src]

pub const fn hexadecimal_len(self, fmt: FormattingFlags) -> usize[src]

Computes how long much space is necessary to write this integer as a hexadecimal literal.

pub const fn binary_len(self, fmt: FormattingFlags) -> usize[src]

Computes how long much space is necessary to write this integer as a binary literal.

impl PWrapper<u32>[src]

pub const fn unsigned_abs(self) -> u32[src]

Returns the absolute value of this integer, as the equivalent unsigned type.

impl PWrapper<u64>[src]

pub const fn hexadecimal_len(self, fmt: FormattingFlags) -> usize[src]

Computes how long much space is necessary to write this integer as a hexadecimal literal.

pub const fn binary_len(self, fmt: FormattingFlags) -> usize[src]

Computes how long much space is necessary to write this integer as a binary literal.

impl PWrapper<u64>[src]

pub const fn unsigned_abs(self) -> u64[src]

Returns the absolute value of this integer, as the equivalent unsigned type.

impl PWrapper<u128>[src]

pub const fn hexadecimal_len(self, fmt: FormattingFlags) -> usize[src]

Computes how long much space is necessary to write this integer as a hexadecimal literal.

pub const fn binary_len(self, fmt: FormattingFlags) -> usize[src]

Computes how long much space is necessary to write this integer as a binary literal.

impl PWrapper<u128>[src]

pub const fn unsigned_abs(self) -> u128[src]

Returns the absolute value of this integer, as the equivalent unsigned type.

impl PWrapper<usize>[src]

pub const fn compute_display_len(self, fmt: FormattingFlags) -> usize[src]

Computes how long much space is necessary to write this integer as a literal.

pub const fn compute_debug_len(self, fmt: FormattingFlags) -> usize[src]

Computes how long much space is necessary to write this integer as a literal.

pub const fn hexadecimal_len(self, fmt: FormattingFlags) -> usize[src]

Computes how long much space is necessary to write this integer as a hexadecimal literal.

pub const fn binary_len(self, fmt: FormattingFlags) -> usize[src]

Computes how long much space is necessary to write this integer as a binary literal.

impl PWrapper<isize>[src]

pub const fn compute_display_len(self, fmt: FormattingFlags) -> usize[src]

Computes how long much space is necessary to write this integer as a literal.

pub const fn compute_debug_len(self, fmt: FormattingFlags) -> usize[src]

Computes how long much space is necessary to write this integer as a literal.

pub const fn hexadecimal_len(self, fmt: FormattingFlags) -> usize[src]

Computes how long much space is necessary to write this integer as a hexadecimal literal.

pub const fn binary_len(self, fmt: FormattingFlags) -> usize[src]

Computes how long much space is necessary to write this integer as a binary literal.

impl PWrapper<usize>[src]

pub const fn unsigned_abs(self) -> usize[src]

Returns the absolute value of this integer.

impl PWrapper<isize>[src]

pub const fn unsigned_abs(self) -> usize[src]

Returns the absolute value of this integer, as the equivalent unsigned type.

impl PWrapper<&[u8]>[src]

pub const fn compute_utf8_debug_len(self) -> usize[src]

Computes how much space is necessary to write the wrapped &[u8] as a utf8 string, with debug formatting

pub const fn compute_utf8_debug_len_in_range(
    self,
    mut range: Range<usize>
) -> usize
[src]

Computes how much space is necessary to write &self.0[range] as a utf8 string, with debug formatting

Trait Implementations

impl<T: Clone> Clone for PWrapper<T>[src]

impl<T: Copy> Copy for PWrapper<T>[src]

impl<P> FormatMarker for PWrapper<P>[src]

type Kind = IsNotStdKind

What kind of type this is, this can be one of: Read more

type This = Self

The type after dereferencing, implemented as type This = Self; for all non-reference types Read more

Auto Trait Implementations

impl<T> Send for PWrapper<T> where
    T: Send
[src]

impl<T> Sync for PWrapper<T> where
    T: Sync
[src]

impl<T> Unpin for PWrapper<T> where
    T: Unpin
[src]

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