Struct const_panic::PanicVal

source ·
pub struct PanicVal<'a> { /* private fields */ }
Expand description

An opaque enum of the values that this crate knows how to format, along with some formatting metadata.

This has constructor functions to make a PanicVal from:

  • bool
  • Integers
  • &str
  • Arrays/Slices of primitives (with the “non_basic” feature, enabled by default)
  • ShortString (with the “non_basic” feature, enabled by default)

Implementations§

Constructs a PanicVal from a ShortString.

Constructs a PanicVal from a char.

A PanicVal that formats to nothing.

How many spaces are printed before this

How many spaces are printed after this

Sets the amount of spaces printed before this to fmtarg.indentation.

Note that only strings can be padded.

Sets the amount of spaces printed after this to fmtarg.indentation.

Note that only strings can be padded.

Constructs a PanicVal which outputs the contents of string verbatim.

Equivalent to PanicVal::from_str(string, FmtArg::DISPLAY)

Constructs a PanicVal from a ShortString, which outputs the string verbatim.

Constructs a PanicVal usable as a separator between fields or elements.

This is sensitive to the fmtarg.is_alternate flag, for more details on that you can look at the docs for Separator::to_panicval

Panics

This panics if string.len() is greater than 12.

Wraps this PanicVal in a single-element array.

Returns a copy of this PanicVal.

Available on crate feature non_basic only.

Constructs a PanicVal from a slice.

Available on crate feature non_basic only.

Constructs a PanicVal from a slice.

Available on crate feature non_basic only.

Constructs a PanicVal from a slice.

Available on crate feature non_basic only.

Constructs a PanicVal from a slice.

Available on crate feature non_basic only.

Constructs a PanicVal from a slice.

Available on crate feature non_basic only.

Constructs a PanicVal from a slice.

Available on crate feature non_basic only.

Constructs a PanicVal from a slice.

Available on crate feature non_basic only.

Constructs a PanicVal from a slice.

Available on crate feature non_basic only.

Constructs a PanicVal from a slice.

Available on crate feature non_basic only.

Constructs a PanicVal from a slice.

Available on crate feature non_basic only.

Constructs a PanicVal from a slice.

Available on crate feature non_basic only.

Constructs a PanicVal from a slice.

Available on crate feature non_basic only.

Constructs a PanicVal from a slice.

Available on crate feature non_basic only.

Constructs a PanicVal from a slice.

Available on crate feature non_basic only.

Constructs a PanicVal from a slice.

Constructs this PanicVal from an integer.

Constructs this PanicVal from an integer.

Constructs this PanicVal from an integer.

Constructs this PanicVal from an integer.

Constructs this PanicVal from an integer.

Constructs this PanicVal from an integer.

Constructs this PanicVal from an integer.

Constructs this PanicVal from an integer.

Constructs this PanicVal from an integer.

Constructs this PanicVal from an integer.

Constructs this PanicVal from an integer.

Constructs this PanicVal from an integer.

Constructs a PanicVal from a bool .

Constructs a PanicVal from a &str

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
The type after dereferencing all references. Read more
Whether this is a user-defined type or standard library type. Read more
The length of the array returned in Self::to_panicvals (an inherent method that formats the type for panic messages). Read more
A marker type that proves that Self implements PanicFmt. 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

Returns the argument unchanged.

A constant of the type witness

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.