pub struct DisplayWithUnit { /* private fields */ }Expand description
A display helper returned by Quantity::display_as(Unit).
Respects all fmt::Formatter flags (precision, width, alignment, etc.):
let d = 384_400.km();
assert_eq!(format!("{:.2}", d.display_as(LengthUnit::Kilometer)), "384400.00 km");Trait Implementations§
Source§impl Clone for DisplayWithUnit
impl Clone for DisplayWithUnit
Source§fn clone(&self) -> DisplayWithUnit
fn clone(&self) -> DisplayWithUnit
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DisplayWithUnit
impl Debug for DisplayWithUnit
Source§impl Display for DisplayWithUnit
impl Display for DisplayWithUnit
impl Copy for DisplayWithUnit
Auto Trait Implementations§
impl Freeze for DisplayWithUnit
impl RefUnwindSafe for DisplayWithUnit
impl Send for DisplayWithUnit
impl Sync for DisplayWithUnit
impl Unpin for DisplayWithUnit
impl UnsafeUnpin for DisplayWithUnit
impl UnwindSafe for DisplayWithUnit
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