pub struct Millisecond<const N: u128 = 1>;Expand description
A unit of time representing exactly N milliseconds.
Implementations§
Source§impl Millisecond
impl Millisecond
Sourcepub const fn per<T>(_larger: T) -> <T as DefaultOutput<Millisecond>>::Outputwhere
T: MultipleOf<Millisecond, <T as DefaultOutput<Millisecond>>::Output> + DefaultOutput<Millisecond> + Copy,
pub const fn per<T>(_larger: T) -> <T as DefaultOutput<Millisecond>>::Outputwhere
T: MultipleOf<Millisecond, <T as DefaultOutput<Millisecond>>::Output> + DefaultOutput<Millisecond> + Copy,
Obtain the number of times Millisecond can fit into T.
If T is smaller than Millisecond, the code will fail to
compile. The return type is the smallest unsigned integer type that can represent
the value.
Valid calls:
Millisecond::per(Millisecond)(returnsu8)Millisecond::per(Second)(returnsu16)Millisecond::per(Minute)(returnsu16)Millisecond::per(Hour)(returnsu32)Millisecond::per(Day)(returnsu32)Millisecond::per(Week)(returnsu32)
Sourcepub const fn per_t<Output>(
larger: impl MultipleOf<Millisecond, Output> + Copy,
) -> Output
pub const fn per_t<Output>( larger: impl MultipleOf<Millisecond, Output> + Copy, ) -> Output
Obtain the number of times Millisecond can fit into T.
If T is smaller than Millisecond, the code will fail to
compile. The return type is any primitive numeric type that can represent the value.
Valid calls:
Millisecond::per(Millisecond)(returnsu8,u16,u32,u64,u128,usize,i8,i16,i32,i64,i128,isize,f32, orf64)Millisecond::per(Second)(returnsu16,u32,u64,u128,usize,i16,i32,i64,i128,isize,f32, orf64)Millisecond::per(Minute)(returnsu16,u32,u64,u128,usize,i32,i64,i128,isize,f32, orf64)Millisecond::per(Hour)(returnsu32,u64,u128,usize,i32,i64,i128,isize,f32, orf64)Millisecond::per(Day)(returnsu32,u64,u128,usize,i32,i64,i128,isize,f32, orf64)Millisecond::per(Week)(returnsu32,u64,u128,usize,i32,i64,i128,isize,f32, orf64)
Trait Implementations§
Source§impl<const N: u128> Clone for Millisecond<N>
impl<const N: u128> Clone for Millisecond<N>
Source§fn clone(&self) -> Millisecond<N>
fn clone(&self) -> Millisecond<N>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<const N: u128> Debug for Millisecond<N>
impl<const N: u128> Debug for Millisecond<N>
Source§impl<const N: u128> Hash for Millisecond<N>
impl<const N: u128> Hash for Millisecond<N>
Source§impl<const N: u128> Ord for Millisecond<N>
impl<const N: u128> Ord for Millisecond<N>
Source§fn cmp(&self, other: &Millisecond<N>) -> Ordering
fn cmp(&self, other: &Millisecond<N>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<const N: u128> PartialEq<Microsecond<N>> for Millisecond<N>
impl<const N: u128> PartialEq<Microsecond<N>> for Millisecond<N>
Source§impl<const N: u128> PartialEq<Millisecond<N>> for Microsecond<N>
impl<const N: u128> PartialEq<Millisecond<N>> for Microsecond<N>
Source§impl<const N: u128> PartialEq<Millisecond<N>> for Nanosecond<N>
impl<const N: u128> PartialEq<Millisecond<N>> for Nanosecond<N>
Source§impl<const N: u128> PartialEq<Nanosecond<N>> for Millisecond<N>
impl<const N: u128> PartialEq<Nanosecond<N>> for Millisecond<N>
Source§impl<const N: u128> PartialEq for Millisecond<N>
impl<const N: u128> PartialEq for Millisecond<N>
Source§impl<const N: u128> PartialOrd<Day<N>> for Millisecond<N>
impl<const N: u128> PartialOrd<Day<N>> for Millisecond<N>
Source§impl<const N: u128> PartialOrd<Hour<N>> for Millisecond<N>
impl<const N: u128> PartialOrd<Hour<N>> for Millisecond<N>
Source§impl<const N: u128> PartialOrd<Microsecond<N>> for Millisecond<N>
impl<const N: u128> PartialOrd<Microsecond<N>> for Millisecond<N>
Source§impl<const N: u128> PartialOrd<Millisecond<N>> for Day<N>
impl<const N: u128> PartialOrd<Millisecond<N>> for Day<N>
Source§impl<const N: u128> PartialOrd<Millisecond<N>> for Hour<N>
impl<const N: u128> PartialOrd<Millisecond<N>> for Hour<N>
Source§impl<const N: u128> PartialOrd<Millisecond<N>> for Microsecond<N>
impl<const N: u128> PartialOrd<Millisecond<N>> for Microsecond<N>
Source§impl<const N: u128> PartialOrd<Millisecond<N>> for Minute<N>
impl<const N: u128> PartialOrd<Millisecond<N>> for Minute<N>
Source§impl<const N: u128> PartialOrd<Millisecond<N>> for Nanosecond<N>
impl<const N: u128> PartialOrd<Millisecond<N>> for Nanosecond<N>
Source§impl<const N: u128> PartialOrd<Millisecond<N>> for Second<N>
impl<const N: u128> PartialOrd<Millisecond<N>> for Second<N>
Source§impl<const N: u128> PartialOrd<Millisecond<N>> for Unit<N>
impl<const N: u128> PartialOrd<Millisecond<N>> for Unit<N>
Source§impl<const N: u128> PartialOrd<Millisecond<N>> for Week<N>
impl<const N: u128> PartialOrd<Millisecond<N>> for Week<N>
Source§impl<const N: u128> PartialOrd<Minute<N>> for Millisecond<N>
impl<const N: u128> PartialOrd<Minute<N>> for Millisecond<N>
Source§impl<const N: u128> PartialOrd<Nanosecond<N>> for Millisecond<N>
impl<const N: u128> PartialOrd<Nanosecond<N>> for Millisecond<N>
Source§impl<const N: u128> PartialOrd<Second<N>> for Millisecond<N>
impl<const N: u128> PartialOrd<Second<N>> for Millisecond<N>
Source§impl<const N: u128> PartialOrd<Unit<N>> for Millisecond<N>
impl<const N: u128> PartialOrd<Unit<N>> for Millisecond<N>
Source§impl<const N: u128> PartialOrd<Week<N>> for Millisecond<N>
impl<const N: u128> PartialOrd<Week<N>> for Millisecond<N>
Source§impl<const N: u128> PartialOrd for Millisecond<N>
impl<const N: u128> PartialOrd for Millisecond<N>
impl<const N: u128> Copy for Millisecond<N>
impl<const N: u128> Eq for Millisecond<N>
impl<const N: u128> StructuralPartialEq for Millisecond<N>
Auto Trait Implementations§
impl<const N: u128> Freeze for Millisecond<N>
impl<const N: u128> RefUnwindSafe for Millisecond<N>
impl<const N: u128> Send for Millisecond<N>
impl<const N: u128> Sync for Millisecond<N>
impl<const N: u128> Unpin for Millisecond<N>
impl<const N: u128> UnwindSafe for Millisecond<N>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more