Struct Second

Source
pub struct Second;
Expand description

A unit of time representing exactly one second.

Implementations§

Source§

impl Second

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 Second can fit into T. If T is smaller than Second, the code will fail to compile. The return type is the smallest unsigned integer type that can represent the value.

Valid calls:

  • Second::per(Second) (returns u8)
  • Second::per(Minute) (returns u8)
  • Second::per(Hour) (returns u16)
  • Second::per(Day) (returns u32)
  • Second::per(Week) (returns u32)
Source

pub const fn per_t<Output>( larger: impl MultipleOf<Self, Output> + Copy, ) -> Output

Obtain the number of times Second can fit into T. If T is smaller than Second, the code will fail to compile. The return type is any primitive numeric type that can represent the value.

Valid calls:

  • Second::per(Second) (returns u8, u16, u32, u64, u128, usize, i8, i16, i32, i64, i128, isize, f32, or f64)
  • Second::per(Minute) (returns u8, u16, u32, u64, u128, usize, i8, i16, i32, i64, i128, isize, f32, or f64)
  • Second::per(Hour) (returns u16, u32, u64, u128, usize, i16, i32, i64, i128, isize, f32, or f64)
  • Second::per(Day) (returns u32, u64, u128, usize, i32, i64, i128, isize, f32, or f64)
  • Second::per(Week) (returns u32, u64, u128, usize, i32, i64, i128, isize, f32, or f64)

Trait Implementations§

Source§

impl Clone for Second

Source§

fn clone(&self) -> Second

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 Second

Source§

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

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

impl DefaultOutput<Microsecond> for Second

Source§

impl DefaultOutput<Millisecond> for Second

Source§

impl DefaultOutput<Nanosecond> for Second

Source§

impl DefaultOutput<Second> for Day

Source§

impl DefaultOutput<Second> for Hour

Source§

impl DefaultOutput<Second> for Minute

Source§

impl DefaultOutput<Second> for Second

Source§

impl DefaultOutput<Second> for Week

Source§

impl MultipleOf<Microsecond, f32> for Second

Source§

const VALUE: f32 = 1.0E+6f32

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

impl MultipleOf<Microsecond, f64> for Second

Source§

const VALUE: f64 = 1.0E+6f64

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

impl MultipleOf<Microsecond, i128> for Second

Source§

const VALUE: i128 = 1_000_000i128

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

impl MultipleOf<Microsecond, i32> for Second

Source§

const VALUE: i32 = 1_000_000i32

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

impl MultipleOf<Microsecond, i64> for Second

Source§

const VALUE: i64 = 1_000_000i64

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

impl MultipleOf<Microsecond, isize> for Second

Source§

const VALUE: isize = 1_000_000isize

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

impl MultipleOf<Microsecond, u128> for Second

Source§

const VALUE: u128 = 1_000_000u128

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

impl MultipleOf<Microsecond, u32> for Second

Source§

const VALUE: u32 = 1_000_000u32

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

impl MultipleOf<Microsecond, u64> for Second

Source§

const VALUE: u64 = 1_000_000u64

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

impl MultipleOf<Microsecond, usize> for Second

Source§

const VALUE: usize = 1_000_000usize

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, f64> for Second

Source§

const VALUE: f64 = 1000f64

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, 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 Second

Source§

const VALUE: i32 = 1_000i32

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, isize> for Second

Source§

const VALUE: isize = 1_000isize

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, 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 Second

Source§

const VALUE: u32 = 1_000u32

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, usize> for Second

Source§

const VALUE: usize = 1_000usize

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

impl MultipleOf<Nanosecond, f32> for Second

Source§

const VALUE: f32 = 1.0E+9f32

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

impl MultipleOf<Nanosecond, f64> for Second

Source§

const VALUE: f64 = 1.0E+9f64

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

impl MultipleOf<Nanosecond, i128> for Second

Source§

const VALUE: i128 = 1_000_000_000i128

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

impl MultipleOf<Nanosecond, i32> for Second

Source§

const VALUE: i32 = 1_000_000_000i32

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

impl MultipleOf<Nanosecond, i64> for Second

Source§

const VALUE: i64 = 1_000_000_000i64

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

impl MultipleOf<Nanosecond, isize> for Second

Source§

const VALUE: isize = 1_000_000_000isize

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

impl MultipleOf<Nanosecond, u128> for Second

Source§

const VALUE: u128 = 1_000_000_000u128

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

impl MultipleOf<Nanosecond, u32> for Second

Source§

const VALUE: u32 = 1_000_000_000u32

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

impl MultipleOf<Nanosecond, u64> for Second

Source§

const VALUE: u64 = 1_000_000_000u64

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

impl MultipleOf<Nanosecond, usize> for Second

Source§

const VALUE: usize = 1_000_000_000usize

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

impl MultipleOf<Second, f32> for Day

Source§

const VALUE: f32 = 86400f32

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

impl MultipleOf<Second, f32> for Hour

Source§

const VALUE: f32 = 3600f32

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

impl MultipleOf<Second, f32> for Minute

Source§

const VALUE: f32 = 60f32

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

impl MultipleOf<Second, f32> for Second

Source§

const VALUE: f32 = 1f32

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

impl MultipleOf<Second, f32> for Week

Source§

const VALUE: f32 = 604800f32

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

impl MultipleOf<Second, f64> for Day

Source§

const VALUE: f64 = 86400f64

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

impl MultipleOf<Second, f64> for Hour

Source§

const VALUE: f64 = 3600f64

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

impl MultipleOf<Second, f64> for Minute

Source§

const VALUE: f64 = 60f64

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

impl MultipleOf<Second, f64> for Second

Source§

const VALUE: f64 = 1f64

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

impl MultipleOf<Second, f64> for Week

Source§

const VALUE: f64 = 604800f64

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

impl MultipleOf<Second, i128> for Day

Source§

const VALUE: i128 = 86_400i128

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

impl MultipleOf<Second, i128> for Hour

Source§

const VALUE: i128 = 3_600i128

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

impl MultipleOf<Second, i128> for Minute

Source§

const VALUE: i128 = 60i128

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

impl MultipleOf<Second, i128> for Second

Source§

const VALUE: i128 = 1i128

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

impl MultipleOf<Second, i128> for Week

Source§

const VALUE: i128 = 604_800i128

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

impl MultipleOf<Second, i16> for Hour

Source§

const VALUE: i16 = 3_600i16

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

impl MultipleOf<Second, i16> for Minute

Source§

const VALUE: i16 = 60i16

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

impl MultipleOf<Second, i16> for Second

Source§

const VALUE: i16 = 1i16

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

impl MultipleOf<Second, i32> for Day

Source§

const VALUE: i32 = 86_400i32

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

impl MultipleOf<Second, i32> for Hour

Source§

const VALUE: i32 = 3_600i32

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

impl MultipleOf<Second, i32> for Minute

Source§

const VALUE: i32 = 60i32

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

impl MultipleOf<Second, i32> for Second

Source§

const VALUE: i32 = 1i32

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

impl MultipleOf<Second, i32> for Week

Source§

const VALUE: i32 = 604_800i32

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

impl MultipleOf<Second, i64> for Day

Source§

const VALUE: i64 = 86_400i64

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

impl MultipleOf<Second, i64> for Hour

Source§

const VALUE: i64 = 3_600i64

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

impl MultipleOf<Second, i64> for Minute

Source§

const VALUE: i64 = 60i64

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

impl MultipleOf<Second, i64> for Second

Source§

const VALUE: i64 = 1i64

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

impl MultipleOf<Second, i64> for Week

Source§

const VALUE: i64 = 604_800i64

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

impl MultipleOf<Second, i8> for Minute

Source§

const VALUE: i8 = 60i8

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

impl MultipleOf<Second, i8> for Second

Source§

const VALUE: i8 = 1i8

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

impl MultipleOf<Second, isize> for Day

Source§

const VALUE: isize = 86_400isize

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

impl MultipleOf<Second, isize> for Hour

Source§

const VALUE: isize = 3_600isize

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

impl MultipleOf<Second, isize> for Minute

Source§

const VALUE: isize = 60isize

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

impl MultipleOf<Second, isize> for Second

Source§

const VALUE: isize = 1isize

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

impl MultipleOf<Second, isize> for Week

Source§

const VALUE: isize = 604_800isize

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

impl MultipleOf<Second, u128> for Day

Source§

const VALUE: u128 = 86_400u128

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

impl MultipleOf<Second, u128> for Hour

Source§

const VALUE: u128 = 3_600u128

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

impl MultipleOf<Second, u128> for Minute

Source§

const VALUE: u128 = 60u128

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

impl MultipleOf<Second, u128> for Second

Source§

const VALUE: u128 = 1u128

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

impl MultipleOf<Second, u128> for Week

Source§

const VALUE: u128 = 604_800u128

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

impl MultipleOf<Second, u16> for Hour

Source§

const VALUE: u16 = 3_600u16

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

impl MultipleOf<Second, u16> for Minute

Source§

const VALUE: u16 = 60u16

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

impl MultipleOf<Second, u16> for Second

Source§

const VALUE: u16 = 1u16

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

impl MultipleOf<Second, u32> for Day

Source§

const VALUE: u32 = 86_400u32

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

impl MultipleOf<Second, u32> for Hour

Source§

const VALUE: u32 = 3_600u32

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

impl MultipleOf<Second, u32> for Minute

Source§

const VALUE: u32 = 60u32

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

impl MultipleOf<Second, u32> for Second

Source§

const VALUE: u32 = 1u32

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

impl MultipleOf<Second, u32> for Week

Source§

const VALUE: u32 = 604_800u32

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

impl MultipleOf<Second, u64> for Day

Source§

const VALUE: u64 = 86_400u64

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

impl MultipleOf<Second, u64> for Hour

Source§

const VALUE: u64 = 3_600u64

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

impl MultipleOf<Second, u64> for Minute

Source§

const VALUE: u64 = 60u64

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

impl MultipleOf<Second, u64> for Second

Source§

const VALUE: u64 = 1u64

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

impl MultipleOf<Second, u64> for Week

Source§

const VALUE: u64 = 604_800u64

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

impl MultipleOf<Second, u8> for Minute

Source§

const VALUE: u8 = 60u8

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

impl MultipleOf<Second, u8> for Second

Source§

const VALUE: u8 = 1u8

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

impl MultipleOf<Second, usize> for Day

Source§

const VALUE: usize = 86_400usize

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

impl MultipleOf<Second, usize> for Hour

Source§

const VALUE: usize = 3_600usize

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

impl MultipleOf<Second, usize> for Minute

Source§

const VALUE: usize = 60usize

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

impl MultipleOf<Second, usize> for Second

Source§

const VALUE: usize = 1usize

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

impl MultipleOf<Second, usize> for Week

Source§

const VALUE: usize = 604_800usize

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

impl Copy for Second

Auto Trait Implementations§

§

impl Freeze for Second

§

impl RefUnwindSafe for Second

§

impl Send for Second

§

impl Sync for Second

§

impl Unpin for Second

§

impl UnwindSafe for Second

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.