Struct indicatif::BinaryBytes
source · pub struct BinaryBytes(pub u64);
Expand description
Formats bytes for human readability using ISO/IEC prefixes
§Examples
assert_eq!("15 B", format!("{}", BinaryBytes(15)));
assert_eq!("1.46 KiB", format!("{}", BinaryBytes(1_500)));
assert_eq!("1.43 MiB", format!("{}", BinaryBytes(1_500_000)));
assert_eq!("1.40 GiB", format!("{}", BinaryBytes(1_500_000_000)));
assert_eq!("1.36 TiB", format!("{}", BinaryBytes(1_500_000_000_000)));
assert_eq!("1.33 PiB", format!("{}", BinaryBytes(1_500_000_000_000_000)));
Tuple Fields§
§0: u64
Trait Implementations§
source§impl Debug for BinaryBytes
impl Debug for BinaryBytes
Auto Trait Implementations§
impl Freeze for BinaryBytes
impl RefUnwindSafe for BinaryBytes
impl Send for BinaryBytes
impl Sync for BinaryBytes
impl Unpin for BinaryBytes
impl UnwindSafe for BinaryBytes
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