GeezerVison is showing doc.rust-lang.org — FormattingOptions in std::fmt - Rust Struct FormattingOptions Source pub struct FormattingOptions { /* private fields */ }
🔬This is a nightly-only experimental API. (formatting_options #118117) Expand descriptionOptions for formatting.
FormattingOptions is a Formatter without an attached Write trait.
It is mainly used to construct Formatter instances.
Implementations§
🔬This is a nightly-only experimental API. (formatting_options #118117)
Construct a new FormattingOptions representing the plain {} formatting specifier:
- no flags,
- filled with spaces,
- no alignment,
- no width,
- no precision, and
- no
DebugAsHex output mode.
🔬This is a nightly-only experimental API. (formatting_options #118117)
Sets or removes the sign (the + or the - flag).
+: This is intended for numeric types and indicates that the sign
should always be printed. By default only the negative sign of signed
values is printed, and the sign of positive or unsigned values is
omitted. This flag indicates that the correct sign (+ or -) should
always be printed.
-: Currently not used
🔬This is a nightly-only experimental API. (formatting_options #118117)
Sets or unsets the 0 flag.
This is used to indicate for integer formats that the padding to width should both be done with a 0 character as well as be sign-aware
🔬This is a nightly-only experimental API. (formatting_options #118117)
Sets or unsets the # flag.
This flag indicates that the “alternate” form of printing should be
used. The alternate forms are:
Debug : pretty-print the Debug formatting (adds linebreaks and indentation)
LowerHex as well as UpperHex - precedes the argument with a 0x
Octal - precedes the argument with a 0o
Binary - precedes the argument with a 0b
🔬This is a nightly-only experimental API. (formatting_options #118117)
Sets the fill character.
The optional fill character and alignment is provided normally in
conjunction with the width parameter. This indicates that if the value
being formatted is smaller than width some extra characters will be
printed around it.
🔬This is a nightly-only experimental API. (formatting_options #118117)
Sets or removes the alignment.
The alignment specifies how the value being formatted should be
positioned if it is smaller than the width of the formatter.
🔬This is a nightly-only experimental API. (formatting_options #118117)
Sets or removes the width.
This is a parameter for the “minimum width” that the format should take
up. If the value’s string does not fill up this many characters, then
the padding specified by FormattingOptions::fill/FormattingOptions::align
will be used to take up the required space.
🔬This is a nightly-only experimental API. (formatting_options #118117)
Sets or removes the precision.
- For non-numeric types, this can be considered a “maximum width”. If
the resulting string is longer than this width, then it is truncated
down to this many characters and that truncated value is emitted with
proper fill, alignment and width if those parameters are set.
- For integral types, this is ignored.
- For floating-point types, this indicates how many digits after the
decimal point should be printed.
🔬This is a nightly-only experimental API. (formatting_options #118117)
Specifies whether the Debug trait should use lower-/upper-case
hexadecimal or normal integers
🔬This is a nightly-only experimental API. (formatting_options #118117)
Returns the current sign (the + or the - flag).
🔬This is a nightly-only experimental API. (formatting_options #118117)
Returns the current 0 flag.
🔬This is a nightly-only experimental API. (formatting_options #118117)
Returns the current # flag.
🔬This is a nightly-only experimental API. (formatting_options #118117)
Returns the current fill character.
🔬This is a nightly-only experimental API. (formatting_options #118117)
Returns the current alignment.
🔬This is a nightly-only experimental API. (formatting_options #118117)
Returns the current width.
🔬This is a nightly-only experimental API. (formatting_options #118117)
Returns the current precision.
🔬This is a nightly-only experimental API. (formatting_options #118117)
Returns the current x? or X? flag.
🔬This is a nightly-only experimental API. (formatting_options #118117)
Trait Implementations§
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Auto Trait Implementations§Blanket Implementations§
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬This is a nightly-only experimental API. (clone_to_uninit #126799) Performs copy-assignment from self to dest. Read more
Returns the argument unchanged.
Calls U::from(self).
That is, this conversion is whatever the implementation of
From<T> for U chooses to do.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion. |