Skip to main content

Module fmt

Module fmt 

1.6.0 Β· Source
Expand description

Utilities for formatting and printing strings.

Re-exportsΒ§

use crate::cell::Cell; πŸ”’
use crate::cell::Ref; πŸ”’
use crate::cell::RefCell; πŸ”’
use crate::cell::RefMut; πŸ”’
use crate::cell::SyncUnsafeCell; πŸ”’ Experimental
use crate::cell::UnsafeCell; πŸ”’
use crate::char::EscapeDebugExtArgs; πŸ”’
use crate::hint::assert_unchecked; πŸ”’
use crate::marker::PhantomData; πŸ”’
use crate::marker::PointeeSized; πŸ”’ Experimental
use crate::num::imp::fmt as numfmt; πŸ”’ Experimental
use crate::ops::Deref; πŸ”’
use crate::ptr::NonNull; πŸ”’
use crate::mem; πŸ”’
use crate::result; πŸ”’
use crate::str; πŸ”’
pub use num_buffer::NumBuffer;
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;
pub use self::builders::from_fn;
pub use num_buffer::NumBufferTrait;Experimental

ModulesΒ§

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

MacrosΒ§

fmt_refs πŸ”’
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Β§

pointer_fmt_inner πŸ”’
Formats an address in fmt::Pointer style.
split_str_by_space πŸ”’
Like .split(' '), but doesn’t bloat binary size
wide_pointer_fmt_inner πŸ”’
Formats a wide pointer (address and type-erased metadata) in fmt::Pointer style.
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.