Module fmt

Source
Expand description

Text formatting utilities.

Structs§

Arguments
This structure represents a safely precompiled version of a format string and its arguments. This cannot be generated at runtime because it cannot safely be done, so no constructors are given and the fields are private to prevent modification.
DebugList
A struct to help with fmt::Debug implementations.
DebugMap
A struct to help with fmt::Debug implementations.
DebugSet
A struct to help with fmt::Debug implementations.
DebugStruct
A struct to help with fmt::Debug implementations.
DebugTuple
A struct to help with fmt::Debug implementations.
DebugValue
A Value which serializes as a string using fmt::Debug.
Error
The error type which is returned from formatting a message into a stream.
FmtOption
A utility to assist with formatting Option values.
FormatWith
A wrapper type that formats the wrapped value using a provided function.
Formatter
Configuration for formatting.
WithIndent
Wraps a type implementing core::fmt::Write so that every newline written to that writer is indented a given amount.
FormattingOptionsExperimental
Options for formatting.
FromFnExperimental
Implements fmt::Debug and fmt::Display using a function.
NumBufferExperimental
A buffer wrapper of which the internal size is based on the maximum number of digits the associated integer can have.

Enums§

Alignment
Possible alignments returned by Formatter::align
DebugAsHexExperimental
Specifies whether the Debug trait should use lower-/upper-case hexadecimal or normal integers.
SignExperimental
The signedness of a Formatter (or of a FormattingOptions).

Traits§

Binary
b formatting.
Debug
? formatting.
Display
Format trait for an empty format, {}.
LowerExp
e formatting.
LowerHex
x formatting.
Octal
o formatting.
Pointer
p formatting.
UpperExp
E formatting.
UpperHex
X formatting.
Write
A trait for writing or formatting into Unicode-accepting buffers or streams.
WriteExt
Extension trait adding additional methods to types implementing core::fmt::Write.
NumBufferTraitExperimental
Trait used to describe the maximum number of digits in decimal base of the implemented integer.

Functions§

alt
Format the provided value using its core::fmt::Debug implementation, with “alternate mode” set
bin
Format the provided value using its core::fmt::Binary implementation.
comma_delimited
Formats a list of F-typed values to the provided writer, delimited with commas.
debug
Wraps a type implementing fmt::Debug as a Value that can be recorded using its Debug implementation.
display
Wraps a type implementing fmt::Display as a Value that can be recorded using its Display implementation.
hex
Format the provided value using its core::fmt::LowerHex implementation.
opt
Borrows an Option as a FmtOption that formats the inner value if the Option is Some, or emits a customizable string if the Option is None.
ptr
Format the provided value using its core::fmt::Pointer implementation.
write
Takes an output stream and an Arguments struct that can be precompiled with the format_args! macro.
from_fnExperimental
Creates a type whose fmt::Debug and fmt::Display impls are provided with the function f.

Type Aliases§

Result
The type returned by formatter methods.

Derive Macros§

Debug
Derive macro generating an impl of the trait Debug.