Struct FormatterOptions
pub struct FormatterOptions { /* private fields */ }
Configuration for formatting.
This struct is obtained from a Formatter. It provides the same functionality as that of a
reference to a Formatter. However, it is not possible to construct a Formatter, which is
necessary for some use cases of SmartDisplay. FormatterOptions implements Default and
has builder methods to alleviate this.
Implementations
impl FormatterOptions
fn with_fill(&mut self, c: char) -> &mut SelfSets the fill character to use whenever there is alignment.
fn with_sign_plus(&mut self, b: bool) -> &mut SelfSet whether the
+flag is specified.fn with_sign_minus(&mut self, b: bool) -> &mut SelfSet whether the
-flag is specified.fn with_align(&mut self, align: Option<Alignment>) -> &mut SelfSet the flag indicating what form of alignment is requested, if any.
fn with_width(&mut self, width: Option<usize>) -> &mut SelfSet the optional integer width that the output should be.
fn with_precision(&mut self, precision: Option<usize>) -> &mut SelfSet the optional precision for numeric types. Alternatively, the maximum width for string types.
fn with_alternate(&mut self, b: bool) -> &mut SelfSet whether the
#flag is specified.fn with_sign_aware_zero_pad(&mut self, b: bool) -> &mut SelfSet whether the
0flag is specified.
impl FormatterOptions
const fn fill(&self) -> charCharacter used as 'fill' whenever there is alignment.
const fn align(&self) -> Option<Alignment>Flag indicating what form of alignment was requested.
const fn width(&self) -> Option<usize>Optionally specified integer width that the output should be.
const fn precision(&self) -> Option<usize>Optionally specified precision for numeric types. Alternatively, the maximum width for string types.
const fn sign_plus(&self) -> boolDetermines if the
+flag was specified.const fn sign_minus(&self) -> boolDetermines if the
-flag was specified.const fn alternate(&self) -> boolDetermines if the
#flag was specified.const fn sign_aware_zero_pad(&self) -> boolDetermines if the
0flag was specified.
Trait Implementations
impl Clone for FormatterOptions
fn clone(&self) -> Self
impl Copy for FormatterOptions
impl Debug for FormatterOptions
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Default for FormatterOptions
fn default() -> Self
impl From<&Formatter<'_>> for FormatterOptions
fn from(value: &Formatter<'_>) -> Self
impl From<&mut Formatter<'_>> for FormatterOptions
fn from(value: &mut Formatter<'_>) -> Self