Enum Unit
#[non_exhaustive]
pub enum Unit<const N: u128 = 1>
A statically-known multiple of a given unit of time.
Variants
-
Nanosecond -
Microsecond -
Millisecond -
Second -
Minute -
Hour -
Day -
Week
Trait Implementations
impl<const N: u128> Clone for Unit<N>
fn clone(&self) -> Unit<N>
impl<const N: u128> Copy for Unit<N>
impl<const N: u128> Debug for Unit<N>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl<const N: u128> Eq for Unit<N>
impl<const N: u128> Hash for Unit<N>
fn hash<__H: Hasher>(&self, state: &mut __H)
impl<const N: u128> Ord for Unit<N>
fn cmp(&self, other: &Unit<N>) -> Ordering
impl<const N: u128> PartialEq for Unit<N>
fn eq(&self, other: &Unit<N>) -> bool
impl<const N: u128> PartialEq<Day<N>> for Unit<N>
fn eq(&self, &Day<N>) -> bool
impl<const N: u128> PartialEq<Hour<N>> for Unit<N>
fn eq(&self, &Hour<N>) -> bool
impl<const N: u128> PartialEq<Microsecond<N>> for Unit<N>
fn eq(&self, &Microsecond<N>) -> bool
impl<const N: u128> PartialEq<Millisecond<N>> for Unit<N>
fn eq(&self, &Millisecond<N>) -> bool
impl<const N: u128> PartialEq<Minute<N>> for Unit<N>
fn eq(&self, &Minute<N>) -> bool
impl<const N: u128> PartialEq<Nanosecond<N>> for Unit<N>
fn eq(&self, &Nanosecond<N>) -> bool
impl<const N: u128> PartialEq<Second<N>> for Unit<N>
fn eq(&self, &Second<N>) -> bool
impl<const N: u128> PartialEq<Week<N>> for Unit<N>
fn eq(&self, &Week<N>) -> bool
impl<const N: u128> PartialOrd for Unit<N>
fn partial_cmp(&self, other: &Unit<N>) -> Option<Ordering>
impl<const N: u128> PartialOrd<Day<N>> for Unit<N>
fn partial_cmp(&self, &Day<N>) -> Option<Ordering>
impl<const N: u128> PartialOrd<Hour<N>> for Unit<N>
fn partial_cmp(&self, &Hour<N>) -> Option<Ordering>
impl<const N: u128> PartialOrd<Microsecond<N>> for Unit<N>
fn partial_cmp(&self, &Microsecond<N>) -> Option<Ordering>
impl<const N: u128> PartialOrd<Millisecond<N>> for Unit<N>
fn partial_cmp(&self, &Millisecond<N>) -> Option<Ordering>
impl<const N: u128> PartialOrd<Minute<N>> for Unit<N>
fn partial_cmp(&self, &Minute<N>) -> Option<Ordering>
impl<const N: u128> PartialOrd<Nanosecond<N>> for Unit<N>
fn partial_cmp(&self, &Nanosecond<N>) -> Option<Ordering>
impl<const N: u128> PartialOrd<Second<N>> for Unit<N>
fn partial_cmp(&self, &Second<N>) -> Option<Ordering>
impl<const N: u128> PartialOrd<Week<N>> for Unit<N>
fn partial_cmp(&self, &Week<N>) -> Option<Ordering>
impl<const N: u128> StructuralPartialEq for Unit<N>
Auto Trait Implementations
impl<const N: u128> Freeze for Unit<N>
impl<const N: u128> RefUnwindSafe for Unit<N>
impl<const N: u128> Send for Unit<N>
impl<const N: u128> Sync for Unit<N>
impl<const N: u128> Unpin for Unit<N>
impl<const N: u128> UnsafeUnpin for Unit<N>
impl<const N: u128> UnwindSafe for Unit<N>
Blanket Implementations
impl<T> Any for Unit<N>
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for Unit<N>
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for Unit<N>
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for Unit<N>
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> From<T> for Unit<N>
fn from(t: T) -> TReturns the argument unchanged.
impl<T, U> Into<U> for Unit<N>
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for Unit<N>
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for Unit<N>
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>