pub struct ByteSize(pub u64);
Expand description
Byte size representation
Tuple Fields§
§0: u64
Implementations§
source§impl ByteSize
impl ByteSize
pub const fn b(size: u64) -> ByteSize
pub const fn kb(size: u64) -> ByteSize
pub const fn kib(size: u64) -> ByteSize
pub const fn mb(size: u64) -> ByteSize
pub const fn mib(size: u64) -> ByteSize
pub const fn gb(size: u64) -> ByteSize
pub const fn gib(size: u64) -> ByteSize
pub const fn tb(size: u64) -> ByteSize
pub const fn tib(size: u64) -> ByteSize
pub const fn pb(size: u64) -> ByteSize
pub const fn pib(size: u64) -> ByteSize
pub fn as_u64(&self) -> u64
pub fn to_string_as(&self, si_unit: bool) -> String
Trait Implementations§
source§impl<T> AddAssign<T> for ByteSize
impl<T> AddAssign<T> for ByteSize
source§fn add_assign(&mut self, rhs: T)
fn add_assign(&mut self, rhs: T)
Performs the
+=
operation. Read moresource§impl AddAssign for ByteSize
impl AddAssign for ByteSize
source§fn add_assign(&mut self, rhs: ByteSize)
fn add_assign(&mut self, rhs: ByteSize)
Performs the
+=
operation. Read moresource§impl<T> MulAssign<T> for ByteSize
impl<T> MulAssign<T> for ByteSize
source§fn mul_assign(&mut self, rhs: T)
fn mul_assign(&mut self, rhs: T)
Performs the
*=
operation. Read moresource§impl Ord for ByteSize
impl Ord for ByteSize
source§impl PartialOrd for ByteSize
impl PartialOrd for ByteSize
impl Copy for ByteSize
impl Eq for ByteSize
impl StructuralPartialEq for ByteSize
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)