Struct quantities::duration::Duration
source · [−]pub struct Duration { /* private fields */ }Expand description
Duration: ‘what a clock reads’
Reference unit: Second (‘s’)
Predefined units:
| Symbol | Name | Definition | Equivalent in ‘s’ |
|---|---|---|---|
| ns | Nanosecond | 0.000000001·s | 0.000000001 |
| µs | Microsecond | 0.000001·s | 0.000001 |
| ms | Millisecond | 0.001·s | 0.001 |
| min | Minute | 60·s | 60 |
| h | Hour | 60·min | 3600 |
| d | Day | 24·h | 86400 |
Trait Implementations
sourceimpl Div<&Duration> for &DataVolume where
DataVolume: Div<Duration>,
impl Div<&Duration> for &DataVolume where
DataVolume: Div<Duration>,
sourceimpl<'a> Div<Duration> for &'a DataVolume where
DataVolume: Div<Duration>,
impl<'a> Div<Duration> for &'a DataVolume where
DataVolume: Div<Duration>,
sourceimpl Div<Duration> for AmountT where
Self: HasRefUnit,
Duration: HasRefUnit,
impl Div<Duration> for AmountT where
Self: HasRefUnit,
Duration: HasRefUnit,
sourceimpl Div<Duration> for DataVolume where
Self: HasRefUnit,
Duration: HasRefUnit,
impl Div<Duration> for DataVolume where
Self: HasRefUnit,
Duration: HasRefUnit,
sourceimpl Div<Duration> for Energy where
Self: HasRefUnit,
Duration: HasRefUnit,
impl Div<Duration> for Energy where
Self: HasRefUnit,
Duration: HasRefUnit,
sourceimpl Div<Duration> for Length where
Self: HasRefUnit,
Duration: HasRefUnit,
impl Div<Duration> for Length where
Self: HasRefUnit,
Duration: HasRefUnit,
sourceimpl Div<Duration> for Speed where
Self: HasRefUnit,
Duration: HasRefUnit,
impl Div<Duration> for Speed where
Self: HasRefUnit,
Duration: HasRefUnit,
sourceimpl HasRefUnit for Duration
impl HasRefUnit for Duration
sourceconst REF_UNIT: DurationUnit = DurationUnit::Second
const REF_UNIT: DurationUnit = DurationUnit::Second
Unit used as reference for scaling the units of Self::UnitType.
sourcefn 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. Read more
sourcefn equiv_amount(&self, unit: Self::UnitType) -> AmountT
fn equiv_amount(&self, unit: Self::UnitType) -> AmountT
Returns factor so that factor * unit == self.
sourcefn 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.
sourcefn eq(&self, other: &Self) -> bool
fn eq(&self, other: &Self) -> bool
Returns true, if self and other have equivalent amounts, otherwise
false. Read more
sourceimpl Mul<&Acceleration> for &Duration where
Duration: Mul<Acceleration>,
impl Mul<&Acceleration> for &Duration where
Duration: Mul<Acceleration>,
type Output = <Duration as Mul<Acceleration>>::Output
type Output = <Duration as Mul<Acceleration>>::Output
The resulting type after applying the * operator.
sourcefn mul(self, rhs: &Acceleration) -> Self::Output
fn mul(self, rhs: &Acceleration) -> Self::Output
Performs the * operation. Read more
sourceimpl Mul<&Acceleration> for Duration where
Self: Mul<Acceleration>,
impl Mul<&Acceleration> for Duration where
Self: Mul<Acceleration>,
type Output = <Duration as Mul<Acceleration>>::Output
type Output = <Duration as Mul<Acceleration>>::Output
The resulting type after applying the * operator.
sourcefn mul(self, rhs: &Acceleration) -> Self::Output
fn mul(self, rhs: &Acceleration) -> Self::Output
Performs the * operation. Read more
sourceimpl Mul<&DataThroughput> for &Duration where
Duration: Mul<DataThroughput>,
impl Mul<&DataThroughput> for &Duration where
Duration: Mul<DataThroughput>,
type Output = <Duration as Mul<DataThroughput>>::Output
type Output = <Duration as Mul<DataThroughput>>::Output
The resulting type after applying the * operator.
sourcefn mul(self, rhs: &DataThroughput) -> Self::Output
fn mul(self, rhs: &DataThroughput) -> Self::Output
Performs the * operation. Read more
sourceimpl Mul<&DataThroughput> for Duration where
Self: Mul<DataThroughput>,
impl Mul<&DataThroughput> for Duration where
Self: Mul<DataThroughput>,
type Output = <Duration as Mul<DataThroughput>>::Output
type Output = <Duration as Mul<DataThroughput>>::Output
The resulting type after applying the * operator.
sourcefn mul(self, rhs: &DataThroughput) -> Self::Output
fn mul(self, rhs: &DataThroughput) -> Self::Output
Performs the * operation. Read more
sourceimpl Mul<&Duration> for &Acceleration where
Acceleration: Mul<Duration>,
impl Mul<&Duration> for &Acceleration where
Acceleration: Mul<Duration>,
sourceimpl Mul<&Duration> for &DataThroughput where
DataThroughput: Mul<Duration>,
impl Mul<&Duration> for &DataThroughput where
DataThroughput: Mul<Duration>,
sourceimpl<'a> Mul<Acceleration> for &'a Duration where
Duration: Mul<Acceleration>,
impl<'a> Mul<Acceleration> for &'a Duration where
Duration: Mul<Acceleration>,
type Output = <Duration as Mul<Acceleration>>::Output
type Output = <Duration as Mul<Acceleration>>::Output
The resulting type after applying the * operator.
sourcefn mul(self, rhs: Acceleration) -> Self::Output
fn mul(self, rhs: Acceleration) -> Self::Output
Performs the * operation. Read more
sourceimpl Mul<Acceleration> for Duration where
Self: HasRefUnit,
Acceleration: HasRefUnit,
impl Mul<Acceleration> for Duration where
Self: HasRefUnit,
Acceleration: HasRefUnit,
sourceimpl<'a> Mul<DataThroughput> for &'a Duration where
Duration: Mul<DataThroughput>,
impl<'a> Mul<DataThroughput> for &'a Duration where
Duration: Mul<DataThroughput>,
type Output = <Duration as Mul<DataThroughput>>::Output
type Output = <Duration as Mul<DataThroughput>>::Output
The resulting type after applying the * operator.
sourcefn mul(self, rhs: DataThroughput) -> Self::Output
fn mul(self, rhs: DataThroughput) -> Self::Output
Performs the * operation. Read more
sourceimpl Mul<DataThroughput> for Duration where
Self: HasRefUnit,
DataThroughput: HasRefUnit,
impl Mul<DataThroughput> for Duration where
Self: HasRefUnit,
DataThroughput: HasRefUnit,
type Output = DataVolume
type Output = DataVolume
The resulting type after applying the * operator.
sourcefn mul(self, rhs: DataThroughput) -> Self::Output
fn mul(self, rhs: DataThroughput) -> Self::Output
Performs the * operation. Read more
sourceimpl<'a> Mul<Duration> for &'a Acceleration where
Acceleration: Mul<Duration>,
impl<'a> Mul<Duration> for &'a Acceleration where
Acceleration: Mul<Duration>,
sourceimpl<'a> Mul<Duration> for &'a DataThroughput where
DataThroughput: Mul<Duration>,
impl<'a> Mul<Duration> for &'a DataThroughput where
DataThroughput: Mul<Duration>,
sourceimpl Mul<Duration> for Acceleration where
Self: HasRefUnit,
Duration: HasRefUnit,
impl Mul<Duration> for Acceleration where
Self: HasRefUnit,
Duration: HasRefUnit,
sourceimpl Mul<Duration> for DataThroughput where
Self: HasRefUnit,
Duration: HasRefUnit,
impl Mul<Duration> for DataThroughput where
Self: HasRefUnit,
Duration: HasRefUnit,
sourceimpl Mul<Duration> for Frequency where
Self: HasRefUnit,
Duration: HasRefUnit,
impl Mul<Duration> for Frequency where
Self: HasRefUnit,
Duration: HasRefUnit,
sourceimpl Mul<Duration> for Power where
Self: HasRefUnit,
Duration: HasRefUnit,
impl Mul<Duration> for Power where
Self: HasRefUnit,
Duration: HasRefUnit,
sourceimpl Mul<Duration> for Speed where
Self: HasRefUnit,
Duration: HasRefUnit,
impl Mul<Duration> for Speed where
Self: HasRefUnit,
Duration: HasRefUnit,
sourceimpl Mul<Frequency> for Duration where
Self: HasRefUnit,
Frequency: HasRefUnit,
impl Mul<Frequency> for Duration where
Self: HasRefUnit,
Frequency: HasRefUnit,
sourceimpl Mul<Power> for Duration where
Self: HasRefUnit,
Power: HasRefUnit,
impl Mul<Power> for Duration where
Self: HasRefUnit,
Power: HasRefUnit,
sourceimpl Mul<Speed> for Duration where
Self: HasRefUnit,
Speed: HasRefUnit,
impl Mul<Speed> for Duration where
Self: HasRefUnit,
Speed: HasRefUnit,
sourceimpl PartialEq<Duration> for Duration
impl PartialEq<Duration> for Duration
sourceimpl PartialOrd<Duration> for Duration
impl PartialOrd<Duration> for Duration
sourcefn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn 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
sourceimpl Quantity for Duration
impl Quantity for Duration
type UnitType = DurationUnit
type UnitType = DurationUnit
Associated type of unit
sourcefn new(amount: AmountT, unit: Self::UnitType) -> Self
fn new(amount: AmountT, unit: Self::UnitType) -> Self
Returns a new instance of the type implementing Quantity.
sourcefn iter_units<'a>() -> Iter<'a, Self::UnitType>
fn iter_units<'a>() -> Iter<'a, Self::UnitType>
Returns an iterator over the variants of Self::UnitType.
sourcefn 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. Read more
sourcefn 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. Read more
sourcefn 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. Read more
sourcefn add(self, rhs: Self) -> Self
fn add(self, rhs: Self) -> Self
Returns the sum of self and other, if both have the same unit. Read more
sourcefn sub(self, rhs: Self) -> Self
fn sub(self, rhs: Self) -> Self
Returns the difference between self and other, if both have the same
unit. Read more
impl Copy for Duration
impl Eq for Duration
Auto Trait Implementations
impl RefUnwindSafe for Duration
impl Send for Duration
impl Sync for Duration
impl Unpin for Duration
impl UnwindSafe for Duration
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more