pub struct DataVolume { /* private fields */ }Expand description
DataVolume according to IEEE 1541-2002
Reference unit: Byte (‘B’)
Predefined units:
| Symbol | Name | Definition | Equivalent in ‘B’ |
|---|---|---|---|
| b | Bit | 0.125·B | 0.125 |
| kb | Kilobit | 1000·b | 125 |
| Kib | Kibibit | 1024·b | 128 |
| kB | Kilobyte | 1000·B | 1000 |
| KiB | Kibibyte | 1024·B | 1024 |
| Mb | Megabit | 1000000·b | 125000 |
| Mib | Mebibit | 1048576·b | 131072 |
| MB | Megabyte | 1000000·B | 1000000 |
| MiB | Mebibyte | 1048576·B | 1048576 |
| Gb | Gigabit | 1000000000·b | 125000000 |
| Gib | Gibibit | 1073741824·b | 134217728 |
| GB | Gigabyte | 1000000000·B | 1000000000 |
| GiB | Gibibyte | 1073741824·B | 1073741824 |
| Tb | Terabit | 1000000000000·b | 125000000000 |
| Tib | Tebibit | 1099511627776·b | 137438953472 |
| TB | Terabyte | 1000000000000·B | 1000000000000 |
| TiB | Tebibyte | 1099511627776·B | 1099511627776 |
Trait Implementations§
Source§impl Add for DataVolume
impl Add for DataVolume
Source§impl Clone for DataVolume
impl Clone for DataVolume
Source§fn clone(&self) -> DataVolume
fn clone(&self) -> DataVolume
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DataVolume
impl Debug for DataVolume
Source§impl Display for DataVolume
impl Display for DataVolume
Source§impl Div<&DataThroughput> for &DataVolume
impl Div<&DataThroughput> for &DataVolume
Source§type Output = <DataVolume as Div<DataThroughput>>::Output
type Output = <DataVolume as Div<DataThroughput>>::Output
The resulting type after applying the
/ operator.Source§impl Div<&DataThroughput> for DataVolumewhere
Self: Div<DataThroughput>,
impl Div<&DataThroughput> for DataVolumewhere
Self: Div<DataThroughput>,
Source§type Output = <DataVolume as Div<DataThroughput>>::Output
type Output = <DataVolume as Div<DataThroughput>>::Output
The resulting type after applying the
/ operator.Source§impl Div<&Duration> for &DataVolume
impl Div<&Duration> for &DataVolume
Source§impl Div<&Duration> for DataVolume
impl Div<&Duration> for DataVolume
Source§impl<'a> Div<DataThroughput> for &'a DataVolume
impl<'a> Div<DataThroughput> for &'a DataVolume
Source§type Output = <DataVolume as Div<DataThroughput>>::Output
type Output = <DataVolume as Div<DataThroughput>>::Output
The resulting type after applying the
/ operator.Source§impl Div<DataThroughput> for DataVolume
impl Div<DataThroughput> for DataVolume
Source§impl<'a> Div<Duration> for &'a DataVolume
impl<'a> Div<Duration> for &'a DataVolume
Source§impl Div<Duration> for DataVolume
impl Div<Duration> for DataVolume
Source§impl<PQ: Quantity> Div<Rate<DataVolume, PQ>> for DataVolume
impl<PQ: Quantity> Div<Rate<DataVolume, PQ>> for DataVolume
Source§impl Div<f64> for DataVolume
impl Div<f64> for DataVolume
Source§impl Div for DataVolume
impl Div for DataVolume
Source§impl HasRefUnit for DataVolume
impl HasRefUnit for DataVolume
Source§const REF_UNIT: DataVolumeUnit = DataVolumeUnit::Byte
const REF_UNIT: DataVolumeUnit = DataVolumeUnit::Byte
Unit used as reference for scaling the units of
Self::UnitType.Source§fn unit_from_scale(amnt: AmountT) -> Option<Self::UnitType>
fn unit_from_scale(amnt: AmountT) -> Option<Self::UnitType>
Returns
Some(unit) where unit.scale() == amnt, or None if
there is no such unit.Source§fn equiv_amount(&self, unit: Self::UnitType) -> AmountT
fn equiv_amount(&self, unit: Self::UnitType) -> AmountT
Returns
factor so that factor * unit == self.Source§fn convert(&self, to_unit: Self::UnitType) -> Self
fn convert(&self, to_unit: Self::UnitType) -> Self
Returns
qty where qty == self and qty.unit() is to_unit.Source§fn eq(&self, other: &Self) -> bool
fn eq(&self, other: &Self) -> bool
Returns true, if
self and other have equivalent amounts, otherwise
false.Source§fn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
Returns the partial order of
selfs amount and others eqivalent
amount in selfs unit.Source§impl Mul<DataVolume> for AmountT
impl Mul<DataVolume> for AmountT
Source§type Output = DataVolume
type Output = DataVolume
The resulting type after applying the
* operator.Source§impl<TQ: Quantity> Mul<Rate<TQ, DataVolume>> for DataVolume
impl<TQ: Quantity> Mul<Rate<TQ, DataVolume>> for DataVolume
Source§impl Mul<f64> for DataVolume
impl Mul<f64> for DataVolume
Source§impl Neg for DataVolume
impl Neg for DataVolume
Source§impl PartialEq for DataVolume
impl PartialEq for DataVolume
Source§impl PartialOrd for DataVolume
impl PartialOrd for DataVolume
Source§impl Quantity for DataVolume
impl Quantity for DataVolume
Source§type UnitType = DataVolumeUnit
type UnitType = DataVolumeUnit
Associated type of unit
Source§fn new(amount: AmountT, unit: Self::UnitType) -> Self
fn new(amount: AmountT, unit: Self::UnitType) -> Self
Returns a new instance of the type implementing
Quantity.Source§fn iter_units() -> impl Iterator<Item = Self::UnitType>
fn iter_units() -> impl Iterator<Item = Self::UnitType>
Returns an iterator over the variants of
Self::UnitType.Source§fn unit_from_symbol(symbol: &str) -> Option<Self::UnitType>
fn unit_from_symbol(symbol: &str) -> Option<Self::UnitType>
Returns
Some(unit) where unit.symbol() == symbol, or None if
there is no such unit.Source§fn eq(&self, other: &Self) -> bool
fn eq(&self, other: &Self) -> bool
Return
true if self and other have the same unit and their
amounts are equal, otherwise false.Source§fn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
Returns the partial order of
selfs and others amounts, if both
have the same unit, otherwise None.Source§impl Sub for DataVolume
impl Sub for DataVolume
impl Copy for DataVolume
impl Eq for DataVolume
Auto Trait Implementations§
impl Freeze for DataVolume
impl RefUnwindSafe for DataVolume
impl Send for DataVolume
impl Sync for DataVolume
impl Unpin for DataVolume
impl UnwindSafe for DataVolume
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