Trait rt_format::value::FormattableValue [−][src]
pub trait FormattableValue { fn supports_format(&self, specifier: &Specifier) -> bool; fn fmt_display(&self, f: &mut Formatter<'_>) -> Result; fn fmt_debug(&self, f: &mut Formatter<'_>) -> Result; fn fmt_octal(&self, f: &mut Formatter<'_>) -> Result; fn fmt_lower_hex(&self, f: &mut Formatter<'_>) -> Result; fn fmt_upper_hex(&self, f: &mut Formatter<'_>) -> Result; fn fmt_binary(&self, f: &mut Formatter<'_>) -> Result; fn fmt_lower_exp(&self, f: &mut Formatter<'_>) -> Result; fn fmt_upper_exp(&self, f: &mut Formatter<'_>) -> Result; }
Expand description
A type that indicates whether its value supports a specific format, and provides formatting functions that correspond to different format types.
Required methods
fn supports_format(&self, specifier: &Specifier) -> bool
fn supports_format(&self, specifier: &Specifier) -> bool
Returns true
if self
can be formatted using the given specifier.
fn fmt_display(&self, f: &mut Formatter<'_>) -> Result
fn fmt_display(&self, f: &mut Formatter<'_>) -> Result
Formats the value the way it would be formatted if it implemented std::fmt::Display
.
Formats the value the way it would be formatted if it implemented std::fmt::Debug
.
Formats the value the way it would be formatted if it implemented std::fmt::Octal
.
fn fmt_lower_hex(&self, f: &mut Formatter<'_>) -> Result
fn fmt_lower_hex(&self, f: &mut Formatter<'_>) -> Result
Formats the value the way it would be formatted if it implemented std::fmt::LowerHex
.
fn fmt_upper_hex(&self, f: &mut Formatter<'_>) -> Result
fn fmt_upper_hex(&self, f: &mut Formatter<'_>) -> Result
Formats the value the way it would be formatted if it implemented std::fmt::UpperHex
.
fn fmt_binary(&self, f: &mut Formatter<'_>) -> Result
fn fmt_binary(&self, f: &mut Formatter<'_>) -> Result
Formats the value the way it would be formatted if it implemented std::fmt::Binary
.
fn fmt_lower_exp(&self, f: &mut Formatter<'_>) -> Result
fn fmt_lower_exp(&self, f: &mut Formatter<'_>) -> Result
Formats the value the way it would be formatted if it implemented std::fmt::LowerExp
.
fn fmt_upper_exp(&self, f: &mut Formatter<'_>) -> Result
fn fmt_upper_exp(&self, f: &mut Formatter<'_>) -> Result
Formats the value the way it would be formatted if it implemented std::fmt::UpperExp
.