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 const fn as_u64(&self) -> u64
pub fn to_string_as(&self, si_unit: bool) -> String
Trait Implementations§
source§impl AddAssign<ByteSize> for ByteSize
impl AddAssign<ByteSize> for ByteSize
source§fn add_assign(&mut self, rhs: ByteSize)
fn add_assign(&mut self, rhs: ByteSize)
Performs the
+=
operation. Read moresource§impl<T> AddAssign<T> for ByteSizewhere
T: Into<u64>,
impl<T> AddAssign<T> for ByteSizewhere T: Into<u64>,
source§fn add_assign(&mut self, rhs: T)
fn add_assign(&mut self, rhs: T)
Performs the
+=
operation. Read moresource§impl<T> MulAssign<T> for ByteSizewhere
T: Into<u64>,
impl<T> MulAssign<T> for ByteSizewhere T: Into<u64>,
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 PartialEq<ByteSize> for ByteSize
impl PartialEq<ByteSize> for ByteSize
source§impl PartialOrd<ByteSize> for ByteSize
impl PartialOrd<ByteSize> for ByteSize
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more