Struct Nanosecond
pub struct Nanosecond<const N: u128 = 1>;
A unit of time representing exactly N nanoseconds.
Implementations
impl Nanosecond<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
Nanosecondcan fit intoT. IfTis smaller thanNanosecond, the code will fail to compile. The return type is the smallest unsigned integer type that can represent the value.Valid calls:
Nanosecond::per(Nanosecond)(returnsu8)Nanosecond::per(Microsecond)(returnsu16)Nanosecond::per(Millisecond)(returnsu32)Nanosecond::per(Second)(returnsu32)Nanosecond::per(Minute)(returnsu64)Nanosecond::per(Hour)(returnsu64)Nanosecond::per(Day)(returnsu64)Nanosecond::per(Week)(returnsu64)
const fn per_t<Output>(larger: impl MultipleOf<Self, Output> + Copy) -> OutputObtain the number of times
Nanosecondcan fit intoT. IfTis smaller thanNanosecond, the code will fail to compile. The return type is any primitive numeric type that can represent the value.Valid calls:
Nanosecond::per(Nanosecond)(returnsu8,u16,u32,u64,u128,usize,i8,i16,i32,i64,i128,isize,f32, orf64)Nanosecond::per(Microsecond)(returnsu16,u32,u64,u128,usize,i16,i32,i64,i128,isize,f32, orf64)Nanosecond::per(Millisecond)(returnsu32,u64,u128,usize,i32,i64,i128,isize,f32, orf64)Nanosecond::per(Second)(returnsu32,u64,u128,usize,i32,i64,i128,isize,f32, orf64)Nanosecond::per(Minute)(returnsu64,u128,i64,i128,f32, orf64)Nanosecond::per(Hour)(returnsu64,u128,i64,i128,f32, orf64)Nanosecond::per(Day)(returnsu64,u128,i64,i128,f32, orf64)Nanosecond::per(Week)(returnsu64,u128,i64,i128,f32, orf64)
Trait Implementations
impl<const N: u128> Clone for Nanosecond<N>
fn clone(&self) -> Self
impl<const N: u128> Copy for Nanosecond<N>
impl<const N: u128> Debug for Nanosecond<N>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl<const N: u128> Eq for Nanosecond<N>
impl<const N: u128> Hash for Nanosecond<N>
fn hash<__H: Hasher>(&self, state: &mut __H)
impl<const N: u128> Ord for Nanosecond<N>
fn cmp(&self, other: &Self) -> Ordering
impl<const N: u128> PartialEq for Nanosecond<N>
fn eq(&self, other: &Self) -> bool
impl<const N: u128> PartialEq<Day<N>> for Nanosecond<N>
fn eq(&self, &Day<N>) -> bool
impl<const N: u128> PartialEq<Hour<N>> for Nanosecond<N>
fn eq(&self, &Hour<N>) -> bool
impl<const N: u128> PartialEq<Microsecond<N>> for Nanosecond<N>
fn eq(&self, &Microsecond<N>) -> bool
impl<const N: u128> PartialEq<Millisecond<N>> for Nanosecond<N>
fn eq(&self, &Millisecond<N>) -> bool
impl<const N: u128> PartialEq<Minute<N>> for Nanosecond<N>
fn eq(&self, &Minute<N>) -> bool
impl<const N: u128> PartialEq<Second<N>> for Nanosecond<N>
fn eq(&self, &Second<N>) -> bool
impl<const N: u128> PartialEq<Unit<N>> for Nanosecond<N>
fn eq(&self, other: &Unit<N>) -> bool
impl<const N: u128> PartialEq<Week<N>> for Nanosecond<N>
fn eq(&self, &Week<N>) -> bool
impl<const N: u128> PartialOrd for Nanosecond<N>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
impl<const N: u128> PartialOrd<Day<N>> for Nanosecond<N>
fn partial_cmp(&self, &Day<N>) -> Option<Ordering>
impl<const N: u128> PartialOrd<Hour<N>> for Nanosecond<N>
fn partial_cmp(&self, &Hour<N>) -> Option<Ordering>
impl<const N: u128> PartialOrd<Microsecond<N>> for Nanosecond<N>
fn partial_cmp(&self, &Microsecond<N>) -> Option<Ordering>
impl<const N: u128> PartialOrd<Millisecond<N>> for Nanosecond<N>
fn partial_cmp(&self, &Millisecond<N>) -> Option<Ordering>
impl<const N: u128> PartialOrd<Minute<N>> for Nanosecond<N>
fn partial_cmp(&self, &Minute<N>) -> Option<Ordering>
impl<const N: u128> PartialOrd<Second<N>> for Nanosecond<N>
fn partial_cmp(&self, &Second<N>) -> Option<Ordering>
impl<const N: u128> PartialOrd<Unit<N>> for Nanosecond<N>
fn partial_cmp(&self, other: &Unit<N>) -> Option<Ordering>
impl<const N: u128> PartialOrd<Week<N>> for Nanosecond<N>
fn partial_cmp(&self, &Week<N>) -> Option<Ordering>