pub struct Formatter { /* private fields */ }
Available on crate features
progress
and unit-human
only.Expand description
Entry point to the lib. Use this to handle your formatting needs.
Implementations§
source§impl Formatter
impl Formatter
sourcepub fn with_decimals(&mut self, decimals: usize) -> &mut Formatter
pub fn with_decimals(&mut self, decimals: usize) -> &mut Formatter
Sets the decimals value for formatting the string.
sourcepub fn with_separator(&mut self, separator: &str) -> &mut Formatter
pub fn with_separator(&mut self, separator: &str) -> &mut Formatter
Sets the separator value for formatting the string.
sourcepub fn with_scales(&mut self, scales: Scales) -> &mut Formatter
pub fn with_scales(&mut self, scales: Scales) -> &mut Formatter
Sets the scales value.
sourcepub fn with_units(&mut self, units: &str) -> &mut Formatter
pub fn with_units(&mut self, units: &str) -> &mut Formatter
Sets the units value.
sourcepub fn with_suffix(&mut self, suffix: &str) -> &mut Formatter
pub fn with_suffix(&mut self, suffix: &str) -> &mut Formatter
Sets the expected suffix value.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Formatter
impl RefUnwindSafe for Formatter
impl Send for Formatter
impl Sync for Formatter
impl Unpin for Formatter
impl UnwindSafe for Formatter
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more