pub struct BinarySize(pub u128);Expand description
Represents size in bytes as per IEC 80000-13
Tuple Fields§
§0: u128Implementations§
Source§impl BinarySize
impl BinarySize
Sourcepub fn rounded_to(self, decimal_places: u8) -> RoundedBinarySize
pub fn rounded_to(self, decimal_places: u8) -> RoundedBinarySize
Returns an instance of RoundedBinarySize that rounds to as many
decimal places as specified in decimal_places upon display
Sourcepub fn rounded(self) -> RoundedBinarySize
pub fn rounded(self) -> RoundedBinarySize
Returns an instance of RoundedBinarySize that rounds to 2 decimal places upon display.
Example:
BinarySize::from(1024_u64).rounded()Trait Implementations§
Source§impl Display for BinarySize
impl Display for BinarySize
Source§impl From<u128> for BinarySize
impl From<u128> for BinarySize
Source§impl From<u16> for BinarySize
impl From<u16> for BinarySize
Source§impl From<u32> for BinarySize
impl From<u32> for BinarySize
Source§impl From<u64> for BinarySize
impl From<u64> for BinarySize
Source§impl From<u8> for BinarySize
impl From<u8> for BinarySize
Auto Trait Implementations§
impl Freeze for BinarySize
impl RefUnwindSafe for BinarySize
impl Send for BinarySize
impl Sync for BinarySize
impl Unpin for BinarySize
impl UnwindSafe for BinarySize
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