pub struct InfoSize(pub u64);Expand description
Information size, stored internally as number of bits
Tuple Fields§
§0: u64Implementations§
Source§impl InfoSize
impl InfoSize
Sourcepub const fn from_parts(n: u64, unit: InfoSizeUnit) -> Self
pub const fn from_parts(n: u64, unit: InfoSizeUnit) -> Self
Create from a number and unit
pub const fn kilobits(&self) -> f64
pub const fn megabits(&self) -> f64
pub const fn gigabits(&self) -> f64
pub const fn terabits(&self) -> f64
pub const fn petabits(&self) -> f64
pub const fn kibibits(&self) -> f64
pub const fn mebibits(&self) -> f64
pub const fn gibibits(&self) -> f64
pub const fn tebibits(&self) -> f64
pub const fn pebibits(&self) -> f64
pub const fn kilobytes(&self) -> f64
pub const fn megabytes(&self) -> f64
pub const fn gigabytes(&self) -> f64
pub const fn terabytes(&self) -> f64
pub const fn petabytes(&self) -> f64
pub const fn kibibytes(&self) -> f64
pub const fn mebibytes(&self) -> f64
pub const fn gibibytes(&self) -> f64
pub const fn tebibytes(&self) -> f64
pub const fn pebibytes(&self) -> f64
Sourcepub fn unit(&self) -> InfoSizeUnit
pub fn unit(&self) -> InfoSizeUnit
Find the most appropriate unit for display
Trait Implementations§
Source§impl<'de> Deserialize<'de> for InfoSize
impl<'de> Deserialize<'de> for InfoSize
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 InfoSize
impl Ord for InfoSize
Source§impl PartialOrd for InfoSize
impl PartialOrd for InfoSize
impl Copy for InfoSize
impl Eq for InfoSize
impl StructuralPartialEq for InfoSize
Auto Trait Implementations§
impl Freeze for InfoSize
impl RefUnwindSafe for InfoSize
impl Send for InfoSize
impl Sync for InfoSize
impl Unpin for InfoSize
impl UnsafeUnpin for InfoSize
impl UnwindSafe for InfoSize
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