pub struct ByteSize(/* private fields */);Expand description
Byte size value.
Implementations§
Source§impl ByteSize
impl ByteSize
Sourcepub const fn from_bytes(bytes: u64) -> Self
pub const fn from_bytes(bytes: u64) -> Self
Creates a size from bytes.
Sourcepub const fn from_kb(kb: u64) -> Self
pub const fn from_kb(kb: u64) -> Self
Creates a size from kibibytes (1 KiB = 1024 bytes).
Saturates to u64::MAX on overflow instead of panicking.
Sourcepub const fn from_mb(mb: u64) -> Self
pub const fn from_mb(mb: u64) -> Self
Creates a size from mebibytes (1 MiB = 1024 KiB).
Saturates to u64::MAX on overflow instead of panicking.
Trait Implementations§
Source§impl Ord for ByteSize
impl Ord for ByteSize
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
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 UnsafeUnpin 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