Struct Millisecond

Source
pub struct Millisecond;
Expand description

A unit of time representing exactly one millisecond.

Implementations§

Source§

impl Millisecond

Source

pub 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 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) (returns u8)
  • Millisecond::per(Second) (returns u16)
  • Millisecond::per(Minute) (returns u16)
  • Millisecond::per(Hour) (returns u32)
  • Millisecond::per(Day) (returns u32)
  • Millisecond::per(Week) (returns u32)
Source

pub const fn per_t<Output>( larger: impl MultipleOf<Self, 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) (returns u8, u16, u32, u64, u128, usize, i8, i16, i32, i64, i128, isize, f32, or f64)
  • Millisecond::per(Second) (returns u16, u32, u64, u128, usize, i16, i32, i64, i128, isize, f32, or f64)
  • Millisecond::per(Minute) (returns u16, u32, u64, u128, usize, i32, i64, i128, isize, f32, or f64)
  • Millisecond::per(Hour) (returns u32, u64, u128, usize, i32, i64, i128, isize, f32, or f64)
  • Millisecond::per(Day) (returns u32, u64, u128, usize, i32, i64, i128, isize, f32, or f64)
  • Millisecond::per(Week) (returns u32, u64, u128, usize, i32, i64, i128, isize, f32, or f64)

Trait Implementations§

Source§

impl Clone for Millisecond

Source§

fn clone(&self) -> Millisecond

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Millisecond

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl DefaultOutput<Microsecond> for Millisecond

Source§

impl DefaultOutput<Millisecond> for Day

Source§

impl DefaultOutput<Millisecond> for Hour

Source§

impl DefaultOutput<Millisecond> for Millisecond

Source§

impl DefaultOutput<Millisecond> for Minute

Source§

impl DefaultOutput<Millisecond> for Second

Source§

impl DefaultOutput<Millisecond> for Week

Source§

impl DefaultOutput<Nanosecond> for Millisecond

Source§

impl MultipleOf<Microsecond, f32> for Millisecond

Source§

const VALUE: f32 = 1000f32

The number of one unit of time in the other.
Source§

impl MultipleOf<Microsecond, f64> for Millisecond

Source§

const VALUE: f64 = 1000f64

The number of one unit of time in the other.
Source§

impl MultipleOf<Microsecond, i128> for Millisecond

Source§

const VALUE: i128 = 1_000i128

The number of one unit of time in the other.
Source§

impl MultipleOf<Microsecond, i16> for Millisecond

Source§

const VALUE: i16 = 1_000i16

The number of one unit of time in the other.
Source§

impl MultipleOf<Microsecond, i32> for Millisecond

Source§

const VALUE: i32 = 1_000i32

The number of one unit of time in the other.
Source§

impl MultipleOf<Microsecond, i64> for Millisecond

Source§

const VALUE: i64 = 1_000i64

The number of one unit of time in the other.
Source§

impl MultipleOf<Microsecond, isize> for Millisecond

Source§

const VALUE: isize = 1_000isize

The number of one unit of time in the other.
Source§

impl MultipleOf<Microsecond, u128> for Millisecond

Source§

const VALUE: u128 = 1_000u128

The number of one unit of time in the other.
Source§

impl MultipleOf<Microsecond, u16> for Millisecond

Source§

const VALUE: u16 = 1_000u16

The number of one unit of time in the other.
Source§

impl MultipleOf<Microsecond, u32> for Millisecond

Source§

const VALUE: u32 = 1_000u32

The number of one unit of time in the other.
Source§

impl MultipleOf<Microsecond, u64> for Millisecond

Source§

const VALUE: u64 = 1_000u64

The number of one unit of time in the other.
Source§

impl MultipleOf<Microsecond, usize> for Millisecond

Source§

const VALUE: usize = 1_000usize

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, f32> for Day

Source§

const VALUE: f32 = 8.64E+7f32

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, f32> for Hour

Source§

const VALUE: f32 = 3.6E+6f32

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, f32> for Millisecond

Source§

const VALUE: f32 = 1f32

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, f32> for Minute

Source§

const VALUE: f32 = 6.0E+4f32

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, f32> for Second

Source§

const VALUE: f32 = 1000f32

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, f32> for Week

Source§

const VALUE: f32 = 6.048E+8f32

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, f64> for Day

Source§

const VALUE: f64 = 8.64E+7f64

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, f64> for Hour

Source§

const VALUE: f64 = 3.6E+6f64

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, f64> for Millisecond

Source§

const VALUE: f64 = 1f64

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, f64> for Minute

Source§

const VALUE: f64 = 6.0E+4f64

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, f64> for Second

Source§

const VALUE: f64 = 1000f64

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, f64> for Week

Source§

const VALUE: f64 = 6.048E+8f64

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, i128> for Day

Source§

const VALUE: i128 = 86_400_000i128

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, i128> for Hour

Source§

const VALUE: i128 = 3_600_000i128

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, i128> for Millisecond

Source§

const VALUE: i128 = 1i128

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, i128> for Minute

Source§

const VALUE: i128 = 60_000i128

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, i128> for Second

Source§

const VALUE: i128 = 1_000i128

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, i128> for Week

Source§

const VALUE: i128 = 604_800_000i128

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, i16> for Millisecond

Source§

const VALUE: i16 = 1i16

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, i16> for Second

Source§

const VALUE: i16 = 1_000i16

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, i32> for Day

Source§

const VALUE: i32 = 86_400_000i32

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, i32> for Hour

Source§

const VALUE: i32 = 3_600_000i32

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, i32> for Millisecond

Source§

const VALUE: i32 = 1i32

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, i32> for Minute

Source§

const VALUE: i32 = 60_000i32

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, i32> for Second

Source§

const VALUE: i32 = 1_000i32

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, i32> for Week

Source§

const VALUE: i32 = 604_800_000i32

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, i64> for Day

Source§

const VALUE: i64 = 86_400_000i64

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, i64> for Hour

Source§

const VALUE: i64 = 3_600_000i64

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, i64> for Millisecond

Source§

const VALUE: i64 = 1i64

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, i64> for Minute

Source§

const VALUE: i64 = 60_000i64

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, i64> for Second

Source§

const VALUE: i64 = 1_000i64

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, i64> for Week

Source§

const VALUE: i64 = 604_800_000i64

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, i8> for Millisecond

Source§

const VALUE: i8 = 1i8

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, isize> for Day

Source§

const VALUE: isize = 86_400_000isize

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, isize> for Hour

Source§

const VALUE: isize = 3_600_000isize

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, isize> for Millisecond

Source§

const VALUE: isize = 1isize

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, isize> for Minute

Source§

const VALUE: isize = 60_000isize

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, isize> for Second

Source§

const VALUE: isize = 1_000isize

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, isize> for Week

Source§

const VALUE: isize = 604_800_000isize

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, u128> for Day

Source§

const VALUE: u128 = 86_400_000u128

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, u128> for Hour

Source§

const VALUE: u128 = 3_600_000u128

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, u128> for Millisecond

Source§

const VALUE: u128 = 1u128

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, u128> for Minute

Source§

const VALUE: u128 = 60_000u128

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, u128> for Second

Source§

const VALUE: u128 = 1_000u128

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, u128> for Week

Source§

const VALUE: u128 = 604_800_000u128

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, u16> for Millisecond

Source§

const VALUE: u16 = 1u16

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, u16> for Minute

Source§

const VALUE: u16 = 60_000u16

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, u16> for Second

Source§

const VALUE: u16 = 1_000u16

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, u32> for Day

Source§

const VALUE: u32 = 86_400_000u32

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, u32> for Hour

Source§

const VALUE: u32 = 3_600_000u32

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, u32> for Millisecond

Source§

const VALUE: u32 = 1u32

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, u32> for Minute

Source§

const VALUE: u32 = 60_000u32

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, u32> for Second

Source§

const VALUE: u32 = 1_000u32

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, u32> for Week

Source§

const VALUE: u32 = 604_800_000u32

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, u64> for Day

Source§

const VALUE: u64 = 86_400_000u64

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, u64> for Hour

Source§

const VALUE: u64 = 3_600_000u64

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, u64> for Millisecond

Source§

const VALUE: u64 = 1u64

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, u64> for Minute

Source§

const VALUE: u64 = 60_000u64

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, u64> for Second

Source§

const VALUE: u64 = 1_000u64

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, u64> for Week

Source§

const VALUE: u64 = 604_800_000u64

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, u8> for Millisecond

Source§

const VALUE: u8 = 1u8

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, usize> for Day

Source§

const VALUE: usize = 86_400_000usize

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, usize> for Hour

Source§

const VALUE: usize = 3_600_000usize

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, usize> for Millisecond

Source§

const VALUE: usize = 1usize

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, usize> for Minute

Source§

const VALUE: usize = 60_000usize

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, usize> for Second

Source§

const VALUE: usize = 1_000usize

The number of one unit of time in the other.
Source§

impl MultipleOf<Millisecond, usize> for Week

Source§

const VALUE: usize = 604_800_000usize

The number of one unit of time in the other.
Source§

impl MultipleOf<Nanosecond, f32> for Millisecond

Source§

const VALUE: f32 = 1.0E+6f32

The number of one unit of time in the other.
Source§

impl MultipleOf<Nanosecond, f64> for Millisecond

Source§

const VALUE: f64 = 1.0E+6f64

The number of one unit of time in the other.
Source§

impl MultipleOf<Nanosecond, i128> for Millisecond

Source§

const VALUE: i128 = 1_000_000i128

The number of one unit of time in the other.
Source§

impl MultipleOf<Nanosecond, i32> for Millisecond

Source§

const VALUE: i32 = 1_000_000i32

The number of one unit of time in the other.
Source§

impl MultipleOf<Nanosecond, i64> for Millisecond

Source§

const VALUE: i64 = 1_000_000i64

The number of one unit of time in the other.
Source§

impl MultipleOf<Nanosecond, isize> for Millisecond

Source§

const VALUE: isize = 1_000_000isize

The number of one unit of time in the other.
Source§

impl MultipleOf<Nanosecond, u128> for Millisecond

Source§

const VALUE: u128 = 1_000_000u128

The number of one unit of time in the other.
Source§

impl MultipleOf<Nanosecond, u32> for Millisecond

Source§

const VALUE: u32 = 1_000_000u32

The number of one unit of time in the other.
Source§

impl MultipleOf<Nanosecond, u64> for Millisecond

Source§

const VALUE: u64 = 1_000_000u64

The number of one unit of time in the other.
Source§

impl MultipleOf<Nanosecond, usize> for Millisecond

Source§

const VALUE: usize = 1_000_000usize

The number of one unit of time in the other.
Source§

impl Copy for Millisecond

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.