Module fmt

1.6.0 ยท Source
Expand description

Utilities for formatting and printing strings.

Re-exportsยง

pub use self::builders::DebugList;
pub use self::builders::DebugMap;
pub use self::builders::DebugSet;
pub use self::builders::DebugStruct;
pub use self::builders::DebugTuple;
pub use self::builders::FromFn;Experimental
pub use self::builders::from_fn;Experimental

Modulesยง

builders ๐Ÿ”’
flags ๐Ÿ”’
float ๐Ÿ”’
macros ๐Ÿ”’
num ๐Ÿ”’
Integer and floating-point number formatting
rt ๐Ÿ”’ Experimental
All types and methods in this file are used by the compiler in the expansion/lowering of format_args!().

Macrosยง

fmt_refs ๐Ÿ”’
last_type ๐Ÿ”’
maybe_tuple_doc ๐Ÿ”’
peel ๐Ÿ”’
tuple ๐Ÿ”’

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.
Error
The error type which is returned from formatting a message into a stream.
Formatter
Configuration for formatting.
PostPadding ๐Ÿ”’
Padding after the end of something. Returned by Formatter::padding.
FormattingOptionsExperimental
Options for formatting.

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.

Functionsยง

getcount ๐Ÿ”’ โš 
pointer_fmt_inner ๐Ÿ”’
Since the formatting will be identical for all pointer types, uses a non-monomorphized implementation for the actual formatting to reduce the amount of codegen work needed.
run ๐Ÿ”’ โš 
write
Takes an output stream and an Arguments struct that can be precompiled with the format_args! macro.

Type Aliasesยง

Result
The type returned by formatter methods.

Derive Macrosยง

Debug
Derive macro generating an impl of the trait Debug.