Module const_panic::fmt
source · Expand description
Formatting-related items
Panic formatting for custom types can be done in these ways (in increasing order of verbosity):
- Using the
PanicFmt
derive macro (requires the opt-in"derive"
feature) - Using the
impl_panicfmt
macro (requires the default-enabled"non_basic"
feature) - Using the
flatten_panicvals
macro (requires the default-enabled"non_basic"
feature) - Manually implementing the
PanicFmt
trait as described in its docs.
Re-exports
pub use self::Delimiter::CloseBrace;
pub use self::Delimiter::CloseBracket;
pub use self::Delimiter::CloseParen;
pub use self::Delimiter::Empty as EmptyDelimiter;
pub use self::Delimiter::OpenBrace;
pub use self::Delimiter::OpenBracket;
pub use self::Delimiter::OpenParen;
Modules
char
-formatted related items
Structs
- ComputePvCount
non_basic
For computing thePanicFmt::PV_COUNT
of a struct or enum variant, with thecall
method. - Carries all of the configuration for formatting functions.
- Marker type used as the
PanicFmt::Kind
for user-defined types. - A marker type that proves that
S
implementsPanicFmt<This = T, Kind = K>
. - Marker type used as the
PanicFmt::Kind
associated type for std types. - PackedFmtArg
non_basic
A version of FmtArg which occupies less space, but needs to be unpacked to be used. - Separator
non_basic
For alternate flag-aware separation of fields, collection elements, etc.
Enums
- Delimiter
non_basic
For outputting an alternate flag-aware delimiter. - What kind of formatting to do, either
Display
orDebug
. - IsLast
non_basic
For tellingSeparator
whether it comes after the last field or not. - What integers are formatted as.
- TypeDelim
non_basic
Whether a struct or variant is Tupled or Braced.
Constants
- COMMA_SEP
non_basic
An alternate-flag-aware comma separator for use between fields or elements. - COMMA_TERM
non_basic
An alternate-flag-aware comma for use after the last field or element. - INDENTATION_STEP
non_basic
How much indentation (in spaces) is added withFmtArg::indent
, and removed withFmtArg::unindent
. - SHORT_STRING_CAP
non_basic
The capacity of aShortString
.
Traits
- Trait for types that can be formatted by const panics.
Type Definitions
- ShortString
non_basic
A stack allocated string type that’s convertible intoPanicVal<'static>
, withSHORT_STRING_CAP
capacity.