pub enum Unit {
Nanosecond,
Microsecond,
Millisecond,
Second,
Minute,
Hour,
Day,
Century,
}
Variants§
Nanosecond
Microsecond
Millisecond
Second
Minute
Hour
Day
Century
36525 days, it the number of days per century in the Julian calendar
Implementations§
source§impl Unit
impl Unit
pub fn in_seconds(&self) -> f64
pub fn from_seconds(&self) -> f64
Trait Implementations§
source§impl AddAssign<Unit> for Duration
impl AddAssign<Unit> for Duration
source§fn add_assign(&mut self, rhs: Unit)
fn add_assign(&mut self, rhs: Unit)
Performs the
+=
operation. Read moresource§impl AddAssign<Unit> for Epoch
impl AddAssign<Unit> for Epoch
source§fn add_assign(&mut self, unit: Unit)
fn add_assign(&mut self, unit: Unit)
Performs the
+=
operation. Read moresource§impl Ord for Unit
impl Ord for Unit
source§impl PartialEq<Unit> for Unit
impl PartialEq<Unit> for Unit
source§impl PartialOrd<Unit> for Duration
impl PartialOrd<Unit> for Duration
1.0.0 · source§fn 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 moresource§impl PartialOrd<Unit> for Unit
impl PartialOrd<Unit> for Unit
1.0.0 · source§fn 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 moresource§impl SubAssign<Unit> for Duration
impl SubAssign<Unit> for Duration
source§fn sub_assign(&mut self, rhs: Unit)
fn sub_assign(&mut self, rhs: Unit)
Performs the
-=
operation. Read moresource§impl SubAssign<Unit> for Epoch
impl SubAssign<Unit> for Epoch
source§fn sub_assign(&mut self, unit: Unit)
fn sub_assign(&mut self, unit: Unit)
Performs the
-=
operation. Read moreimpl Copy for Unit
impl Eq for Unit
impl StructuralEq for Unit
impl StructuralPartialEq for Unit
Auto Trait Implementations§
impl RefUnwindSafe for Unit
impl Send for Unit
impl Sync for Unit
impl Unpin for Unit
impl UnwindSafe for Unit
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.