Struct Microsecond
pub struct Microsecond<const N: u128 = 1>;
A unit of time representing exactly N microseconds.
Implementations
impl Microsecond<1>
const fn per<T>(_larger: T) -> <T as DefaultOutput<Self>>::Output where T: MultipleOf<Self, T::Output> + DefaultOutput<Self> + Copy,Obtain the number of times
Microsecondcan fit intoT. IfTis smaller thanMicrosecond, the code will fail to compile. The return type is the smallest unsigned integer type that can represent the value.Valid calls:
Microsecond::per(Microsecond)(returnsu8)Microsecond::per(Millisecond)(returnsu16)Microsecond::per(Second)(returnsu32)Microsecond::per(Minute)(returnsu32)Microsecond::per(Hour)(returnsu32)Microsecond::per(Day)(returnsu64)Microsecond::per(Week)(returnsu64)
const fn per_t<Output>(larger: impl MultipleOf<Self, Output> + Copy) -> OutputObtain the number of times
Microsecondcan fit intoT. IfTis smaller thanMicrosecond, the code will fail to compile. The return type is any primitive numeric type that can represent the value.Valid calls:
Microsecond::per(Microsecond)(returnsu8,u16,u32,u64,u128,usize,i8,i16,i32,i64,i128,isize,f32, orf64)Microsecond::per(Millisecond)(returnsu16,u32,u64,u128,usize,i16,i32,i64,i128,isize,f32, orf64)Microsecond::per(Second)(returnsu32,u64,u128,usize,i32,i64,i128,isize,f32, orf64)Microsecond::per(Minute)(returnsu32,u64,u128,usize,i32,i64,i128,isize,f32, orf64)Microsecond::per(Hour)(returnsu32,u64,u128,i64,i128,f32, orf64)Microsecond::per(Day)(returnsu64,u128,i64,i128,f32, orf64)Microsecond::per(Week)(returnsu64,u128,i64,i128,f32, orf64)
Trait Implementations
impl<const N: u128> Clone for Microsecond<N>
fn clone(&self) -> Microsecond<N>
impl<const N: u128> Copy for Microsecond<N>
impl<const N: u128> Debug for Microsecond<N>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl<const N: u128> Eq for Microsecond<N>
impl<const N: u128> Hash for Microsecond<N>
fn hash<__H: Hasher>(&self, state: &mut __H)
impl<const N: u128> Ord for Microsecond<N>
fn cmp(&self, other: &Microsecond<N>) -> Ordering
impl<const N: u128> PartialEq for Microsecond<N>
fn eq(&self, other: &Microsecond<N>) -> bool
impl<const N: u128> PartialEq<Day<N>> for Microsecond<N>
fn eq(&self, &Day<N>) -> bool
impl<const N: u128> PartialEq<Hour<N>> for Microsecond<N>
fn eq(&self, &Hour<N>) -> bool
impl<const N: u128> PartialEq<Millisecond<N>> for Microsecond<N>
fn eq(&self, &Millisecond<N>) -> bool
impl<const N: u128> PartialEq<Minute<N>> for Microsecond<N>
fn eq(&self, &Minute<N>) -> bool
impl<const N: u128> PartialEq<Nanosecond<N>> for Microsecond<N>
fn eq(&self, &Nanosecond<N>) -> bool
impl<const N: u128> PartialEq<Second<N>> for Microsecond<N>
fn eq(&self, &Second<N>) -> bool
impl<const N: u128> PartialEq<Unit<N>> for Microsecond<N>
fn eq(&self, other: &Unit<N>) -> bool
impl<const N: u128> PartialEq<Week<N>> for Microsecond<N>
fn eq(&self, &Week<N>) -> bool
impl<const N: u128> PartialOrd for Microsecond<N>
fn partial_cmp(&self, other: &Microsecond<N>) -> Option<Ordering>
impl<const N: u128> PartialOrd<Day<N>> for Microsecond<N>
fn partial_cmp(&self, &Day<N>) -> Option<Ordering>
impl<const N: u128> PartialOrd<Hour<N>> for Microsecond<N>
fn partial_cmp(&self, &Hour<N>) -> Option<Ordering>
impl<const N: u128> PartialOrd<Millisecond<N>> for Microsecond<N>
fn partial_cmp(&self, &Millisecond<N>) -> Option<Ordering>
impl<const N: u128> PartialOrd<Minute<N>> for Microsecond<N>
fn partial_cmp(&self, &Minute<N>) -> Option<Ordering>
impl<const N: u128> PartialOrd<Nanosecond<N>> for Microsecond<N>
fn partial_cmp(&self, &Nanosecond<N>) -> Option<Ordering>
impl<const N: u128> PartialOrd<Second<N>> for Microsecond<N>
fn partial_cmp(&self, &Second<N>) -> Option<Ordering>
impl<const N: u128> PartialOrd<Unit<N>> for Microsecond<N>
fn partial_cmp(&self, other: &Unit<N>) -> Option<Ordering>
impl<const N: u128> PartialOrd<Week<N>> for Microsecond<N>
fn partial_cmp(&self, &Week<N>) -> Option<Ordering>
impl<const N: u128> StructuralPartialEq for Microsecond<N>
Auto Trait Implementations
impl<const N: u128> Freeze for Microsecond<N>
impl<const N: u128> RefUnwindSafe for Microsecond<N>
impl<const N: u128> Send for Microsecond<N>
impl<const N: u128> Sync for Microsecond<N>
impl<const N: u128> Unpin for Microsecond<N>
impl<const N: u128> UnsafeUnpin for Microsecond<N>
impl<const N: u128> UnwindSafe for Microsecond<N>
Blanket Implementations
impl<T> Any for Microsecond<N>
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for Microsecond<N>
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for Microsecond<N>
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for Microsecond<N>
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> From<T> for Microsecond<N>
fn from(t: T) -> TReturns the argument unchanged.
impl<T, U> Into<U> for Microsecond<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 Microsecond<N>
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for Microsecond<N>
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>