Struct const_panic::StdWrapper[][src]

#[repr(transparent)]
pub struct StdWrapper<T>(pub T);
Expand description

A wrapper type used to define methods for std types.

Std types are coerced to this type through the approach used in the coerce_fmt macro.

Example

Formatting std types with this type’s to_panicvals methods, without using macros.

use const_panic::{ArrayString, FmtArg, StdWrapper};

assert_eq!(
    ArrayString::<99>::from_panicvals(
        &StdWrapper("hello").to_panicvals(FmtArg::DEBUG)
    ).unwrap(),
    r#""hello""#
);

assert_eq!(
    ArrayString::<99>::from_panicvals(
        &StdWrapper(&[3u8, 5, 8]).to_panicvals(FmtArg::ALT_DEBUG)
    ).unwrap(),
    "[\n    3,\n    5,\n    8,\n]"
);

Tuple Fields

0: T

Implementations

This is supported on crate feature non_basic only.

Converts the slice to a single-element PanicVal array.

This is supported on crate feature non_basic only.

Converts the slice to a PanicVal.

This is supported on crate feature non_basic only.

Converts the array to a single-element PanicVal array.

This is supported on crate feature non_basic only.

Converts the array to a PanicVal.

This is supported on crate feature non_basic only.

Converts the slice to a single-element PanicVal array.

This is supported on crate feature non_basic only.

Converts the slice to a PanicVal.

This is supported on crate feature non_basic only.

Converts the array to a single-element PanicVal array.

This is supported on crate feature non_basic only.

Converts the array to a PanicVal.

This is supported on crate feature non_basic only.

Converts the slice to a single-element PanicVal array.

This is supported on crate feature non_basic only.

Converts the slice to a PanicVal.

This is supported on crate feature non_basic only.

Converts the array to a single-element PanicVal array.

This is supported on crate feature non_basic only.

Converts the array to a PanicVal.

This is supported on crate feature non_basic only.

Converts the slice to a single-element PanicVal array.

This is supported on crate feature non_basic only.

Converts the slice to a PanicVal.

This is supported on crate feature non_basic only.

Converts the array to a single-element PanicVal array.

This is supported on crate feature non_basic only.

Converts the array to a PanicVal.

This is supported on crate feature non_basic only.

Converts the slice to a single-element PanicVal array.

This is supported on crate feature non_basic only.

Converts the slice to a PanicVal.

This is supported on crate feature non_basic only.

Converts the array to a single-element PanicVal array.

This is supported on crate feature non_basic only.

Converts the array to a PanicVal.

This is supported on crate feature non_basic only.

Converts the slice to a single-element PanicVal array.

This is supported on crate feature non_basic only.

Converts the slice to a PanicVal.

This is supported on crate feature non_basic only.

Converts the array to a single-element PanicVal array.

This is supported on crate feature non_basic only.

Converts the array to a PanicVal.

This is supported on crate feature non_basic only.

Converts the slice to a single-element PanicVal array.

This is supported on crate feature non_basic only.

Converts the slice to a PanicVal.

This is supported on crate feature non_basic only.

Converts the array to a single-element PanicVal array.

This is supported on crate feature non_basic only.

Converts the array to a PanicVal.

This is supported on crate feature non_basic only.

Converts the slice to a single-element PanicVal array.

This is supported on crate feature non_basic only.

Converts the slice to a PanicVal.

This is supported on crate feature non_basic only.

Converts the array to a single-element PanicVal array.

This is supported on crate feature non_basic only.

Converts the array to a PanicVal.

This is supported on crate feature non_basic only.

Converts the slice to a single-element PanicVal array.

This is supported on crate feature non_basic only.

Converts the slice to a PanicVal.

This is supported on crate feature non_basic only.

Converts the array to a single-element PanicVal array.

This is supported on crate feature non_basic only.

Converts the array to a PanicVal.

This is supported on crate feature non_basic only.

Converts the slice to a single-element PanicVal array.

This is supported on crate feature non_basic only.

Converts the slice to a PanicVal.

This is supported on crate feature non_basic only.

Converts the array to a single-element PanicVal array.

This is supported on crate feature non_basic only.

Converts the array to a PanicVal.

This is supported on crate feature non_basic only.

Converts the slice to a single-element PanicVal array.

This is supported on crate feature non_basic only.

Converts the slice to a PanicVal.

This is supported on crate feature non_basic only.

Converts the array to a single-element PanicVal array.

This is supported on crate feature non_basic only.

Converts the array to a PanicVal.

This is supported on crate feature non_basic only.

Converts the slice to a single-element PanicVal array.

This is supported on crate feature non_basic only.

Converts the slice to a PanicVal.

This is supported on crate feature non_basic only.

Converts the array to a single-element PanicVal array.

This is supported on crate feature non_basic only.

Converts the array to a PanicVal.

This is supported on crate feature non_basic only.

Converts the slice to a single-element PanicVal array.

This is supported on crate feature non_basic only.

Converts the slice to a PanicVal.

This is supported on crate feature non_basic only.

Converts the array to a single-element PanicVal array.

This is supported on crate feature non_basic only.

Converts the array to a PanicVal.

This is supported on crate feature non_basic only.

Converts the slice to a single-element PanicVal array.

This is supported on crate feature non_basic only.

Converts the slice to a PanicVal.

This is supported on crate feature non_basic only.

Converts the array to a single-element PanicVal array.

This is supported on crate feature non_basic only.

Converts the array to a PanicVal.

Converts this integer to a single-element PanicVal array.

Converts this integer to a PanicVal.

Converts this integer to a single-element PanicVal array.

Converts this integer to a PanicVal.

Converts this integer to a single-element PanicVal array.

Converts this integer to a PanicVal.

Converts this integer to a single-element PanicVal array.

Converts this integer to a PanicVal.

Converts this integer to a single-element PanicVal array.

Converts this integer to a PanicVal.

Converts this integer to a single-element PanicVal array.

Converts this integer to a PanicVal.

Converts this integer to a single-element PanicVal array.

Converts this integer to a PanicVal.

Converts this integer to a single-element PanicVal array.

Converts this integer to a PanicVal.

Converts this integer to a single-element PanicVal array.

Converts this integer to a PanicVal.

Converts this integer to a single-element PanicVal array.

Converts this integer to a PanicVal.

Converts this integer to a single-element PanicVal array.

Converts this integer to a PanicVal.

Converts this integer to a single-element PanicVal array.

Converts this integer to a PanicVal.

Formats this bool into a single-PanicVal array

Formats this bool into a PanicVal

Formats this &str into a single-PanicVal array

Formats this &str into a PanicVal

Coerces a &&[PanicVal<'_>] into a &[PanicVal<'_>]

Coerces a &&[PanicVal<'_>; N] into a &[PanicVal<'_>]

Coerces a &[PanicVal<'_>; N] into a &[PanicVal<'_>]

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.