#[repr(transparent)]pub struct ByteSize(pub usize);
Expand description
A pretty printer for byte sizes.
§Example
use starina_utils::byte_size::ByteSize;
assert_eq!(format!("{}", ByteSize(128)), "128 B");
assert_eq!(format!("{}", ByteSize(1024)), "1 KiB");
assert_eq!(format!("{}", ByteSize(16 * 1024 * 1024)), "16 MiB");
Tuple Fields§
§0: usize
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ByteSize
impl RefUnwindSafe for ByteSize
impl Send for ByteSize
impl Sync for ByteSize
impl Unpin for ByteSize
impl UnwindSafe for ByteSize
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