pub struct ByteUnit(/* private fields */);Implementations§
Source§impl ByteUnit
impl ByteUnit
pub const ZERO: ByteUnit
pub const MAX: ByteUnit
pub const KB: ByteUnit
pub const MB: ByteUnit
pub const GB: ByteUnit
pub const TB: ByteUnit
pub const PB: ByteUnit
pub const EB: ByteUnit
pub const fn new(bytes: u64) -> ByteUnit
pub const fn size_of<T>() -> ByteUnit
pub const fn as_u64(&self) -> u64
pub const fn as_u32(&self) -> u32
pub const fn as_u16(&self) -> u16
pub const fn as_usize(&self) -> usize
pub const fn is_power_of_two(&self) -> bool
pub const fn from_kb(kb: u64) -> ByteUnit
pub const fn from_mb(mb: u64) -> ByteUnit
pub const fn from_gb(gb: u64) -> ByteUnit
pub const fn from_tb(tb: u64) -> ByteUnit
pub const fn from_pb(pb: u64) -> ByteUnit
pub const fn from_eb(eb: u64) -> ByteUnit
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ByteUnit
impl<'de> Deserialize<'de> for ByteUnit
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for ByteUnit
impl Ord for ByteUnit
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<ByteUnit> for i16
impl PartialOrd<ByteUnit> for i16
Source§impl PartialOrd<ByteUnit> for i32
impl PartialOrd<ByteUnit> for i32
Source§impl PartialOrd<ByteUnit> for i64
impl PartialOrd<ByteUnit> for i64
Source§impl PartialOrd<ByteUnit> for i8
impl PartialOrd<ByteUnit> for i8
Source§impl PartialOrd<ByteUnit> for isize
impl PartialOrd<ByteUnit> for isize
Source§impl PartialOrd<ByteUnit> for u16
impl PartialOrd<ByteUnit> for u16
Source§impl PartialOrd<ByteUnit> for u32
impl PartialOrd<ByteUnit> for u32
Source§impl PartialOrd<ByteUnit> for u64
impl PartialOrd<ByteUnit> for u64
Source§impl PartialOrd<ByteUnit> for u8
impl PartialOrd<ByteUnit> for u8
Source§impl PartialOrd<ByteUnit> for usize
impl PartialOrd<ByteUnit> for usize
Source§impl<T: Into<ByteUnit> + Copy> PartialOrd<T> for ByteUnit
impl<T: Into<ByteUnit> + Copy> PartialOrd<T> for ByteUnit
impl Copy for ByteUnit
impl Eq for ByteUnit
Auto Trait Implementations§
impl Freeze for ByteUnit
impl RefUnwindSafe for ByteUnit
impl Send for ByteUnit
impl Sync for ByteUnit
impl Unpin for ByteUnit
impl UnsafeUnpin for ByteUnit
impl UnwindSafe for ByteUnit
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§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.