pub trait Printf {
// Required methods
fn format(&self, spec: &ConversionSpecifier) -> Result<String>;
fn as_int(&self) -> Option<i32>;
}
Expand description
Trait for types that can be formatted using printf strings
Implemented for the basic types and shouldn’t need implementing for anything else.
Required Methods§
sourcefn format(&self, spec: &ConversionSpecifier) -> Result<String>
fn format(&self, spec: &ConversionSpecifier) -> Result<String>
Format self
based on the conversion configured in spec
.