Expand description
Formatting-related items
Panic formatting for custom types can be done in these ways (in increasing order of verbosity):
- Using the
PanicFmtderive macro (requires the opt-in"derive"feature) - Using the
impl_panicfmtmacro (requires the default-enabled"non_basic"feature) - Using the
flatten_panicvalsmacro (requires the default-enabled"non_basic"feature) - Manually implementing the
PanicFmttrait 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_
formatting char-formatted related items
Structs§
- Compute
PvCount - For computing the
PanicFmt::PV_COUNTof a struct or enum variant, with thecallmethod. - FmtArg
- Carries all of the configuration for formatting functions.
- IsCustom
Type - Marker type used as the
PanicFmt::Kindfor user-defined types. - IsPanic
Fmt - A marker type that proves that
SimplementsPanicFmt<This = T, Kind = K>. - IsStd
Type - Marker type used as the
PanicFmt::Kindassociated type for std types. - Packed
FmtArg - A version of FmtArg which occupies less space, but needs to be unpacked to be used.
- Separator
- For alternate flag-aware separation of fields, collection elements, etc.
Enums§
- Delimiter
- For outputting an alternate flag-aware delimiter.
- FmtKind
- What kind of formatting to do, either
DisplayorDebug. - IsLast
- For telling
Separatorwhether it comes after the last field or not. - Number
Fmt - What integers are formatted as.
- Type
Delim - Whether a struct or variant is Tupled or Braced.
Constants§
- COMMA_
SEP - An alternate-flag-aware comma separator for use between fields or elements.
- COMMA_
TERM - An alternate-flag-aware comma for use after the last field or element.
- INDENTATION_
STEP - How much indentation (in spaces) is added with
FmtArg::indent, and removed withFmtArg::unindent. - SHORT_
STRING_ CAP - The capacity of a
ShortString.
Traits§
- Coerce
Return - Computes the type that the
Targument is converted into byIsPanicFmt::coerce. - Panic
Fmt - Trait for types that can be formatted by const panics.
Type Aliases§
- Coerce
Return Output - Computes the type that the
Targument is converted into byIsPanicFmt::coerce. - Short
String - A stack allocated string type that’s convertible into
PanicVal<'static>, withSHORT_STRING_CAPcapacity.