pub struct Millisecond;
Expand description
A unit of time representing exactly one millisecond.
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 Clone for Millisecond
impl Clone for Millisecond
Source§fn clone(&self) -> Millisecond
fn clone(&self) -> Millisecond
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 Debug for Millisecond
impl Debug for Millisecond
impl Copy for Millisecond
Auto Trait Implementations§
impl Freeze for Millisecond
impl RefUnwindSafe for Millisecond
impl Send for Millisecond
impl Sync for Millisecond
impl Unpin for Millisecond
impl UnwindSafe for Millisecond
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