Struct Day

Source
pub struct Day;
Expand description

A unit of time representing exactly one day.

Implementations§

Source§

impl Day

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

Valid calls:

  • Day::per(Day) (returns u8)
  • Day::per(Week) (returns u8)
Source

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

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

Valid calls:

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

Trait Implementations§

Source§

impl Clone for Day

Source§

fn clone(&self) -> Day

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 Day

Source§

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

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

impl DefaultOutput<Day> for Day

Source§

impl DefaultOutput<Day> for Week

Source§

impl DefaultOutput<Hour> for Day

Source§

impl DefaultOutput<Microsecond> for Day

Source§

impl DefaultOutput<Millisecond> for Day

Source§

impl DefaultOutput<Minute> for Day

Source§

impl DefaultOutput<Nanosecond> for Day

Source§

impl DefaultOutput<Second> for Day

Source§

impl MultipleOf<Day, f32> for Day

Source§

const VALUE: f32 = 1f32

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

impl MultipleOf<Day, f32> for Week

Source§

const VALUE: f32 = 7f32

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

impl MultipleOf<Day, f64> for Day

Source§

const VALUE: f64 = 1f64

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

impl MultipleOf<Day, f64> for Week

Source§

const VALUE: f64 = 7f64

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

impl MultipleOf<Day, i128> for Day

Source§

const VALUE: i128 = 1i128

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

impl MultipleOf<Day, i128> for Week

Source§

const VALUE: i128 = 7i128

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

impl MultipleOf<Day, i16> for Day

Source§

const VALUE: i16 = 1i16

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

impl MultipleOf<Day, i16> for Week

Source§

const VALUE: i16 = 7i16

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

impl MultipleOf<Day, i32> for Day

Source§

const VALUE: i32 = 1i32

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

impl MultipleOf<Day, i32> for Week

Source§

const VALUE: i32 = 7i32

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

impl MultipleOf<Day, i64> for Day

Source§

const VALUE: i64 = 1i64

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

impl MultipleOf<Day, i64> for Week

Source§

const VALUE: i64 = 7i64

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

impl MultipleOf<Day, i8> for Day

Source§

const VALUE: i8 = 1i8

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

impl MultipleOf<Day, i8> for Week

Source§

const VALUE: i8 = 7i8

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

impl MultipleOf<Day, isize> for Day

Source§

const VALUE: isize = 1isize

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

impl MultipleOf<Day, isize> for Week

Source§

const VALUE: isize = 7isize

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

impl MultipleOf<Day, u128> for Day

Source§

const VALUE: u128 = 1u128

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

impl MultipleOf<Day, u128> for Week

Source§

const VALUE: u128 = 7u128

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

impl MultipleOf<Day, u16> for Day

Source§

const VALUE: u16 = 1u16

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

impl MultipleOf<Day, u16> for Week

Source§

const VALUE: u16 = 7u16

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

impl MultipleOf<Day, u32> for Day

Source§

const VALUE: u32 = 1u32

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

impl MultipleOf<Day, u32> for Week

Source§

const VALUE: u32 = 7u32

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

impl MultipleOf<Day, u64> for Day

Source§

const VALUE: u64 = 1u64

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

impl MultipleOf<Day, u64> for Week

Source§

const VALUE: u64 = 7u64

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

impl MultipleOf<Day, u8> for Day

Source§

const VALUE: u8 = 1u8

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

impl MultipleOf<Day, u8> for Week

Source§

const VALUE: u8 = 7u8

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

impl MultipleOf<Day, usize> for Day

Source§

const VALUE: usize = 1usize

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

impl MultipleOf<Day, usize> for Week

Source§

const VALUE: usize = 7usize

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

impl MultipleOf<Hour, f32> for Day

Source§

const VALUE: f32 = 24f32

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

impl MultipleOf<Hour, f64> for Day

Source§

const VALUE: f64 = 24f64

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

impl MultipleOf<Hour, i128> for Day

Source§

const VALUE: i128 = 24i128

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

impl MultipleOf<Hour, i16> for Day

Source§

const VALUE: i16 = 24i16

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

impl MultipleOf<Hour, i32> for Day

Source§

const VALUE: i32 = 24i32

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

impl MultipleOf<Hour, i64> for Day

Source§

const VALUE: i64 = 24i64

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

impl MultipleOf<Hour, i8> for Day

Source§

const VALUE: i8 = 24i8

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

impl MultipleOf<Hour, isize> for Day

Source§

const VALUE: isize = 24isize

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

impl MultipleOf<Hour, u128> for Day

Source§

const VALUE: u128 = 24u128

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

impl MultipleOf<Hour, u16> for Day

Source§

const VALUE: u16 = 24u16

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

impl MultipleOf<Hour, u32> for Day

Source§

const VALUE: u32 = 24u32

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

impl MultipleOf<Hour, u64> for Day

Source§

const VALUE: u64 = 24u64

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

impl MultipleOf<Hour, u8> for Day

Source§

const VALUE: u8 = 24u8

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

impl MultipleOf<Hour, usize> for Day

Source§

const VALUE: usize = 24usize

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

impl MultipleOf<Microsecond, f32> for Day

Source§

const VALUE: f32 = 8.64E+10f32

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

impl MultipleOf<Microsecond, f64> for Day

Source§

const VALUE: f64 = 8.64E+10f64

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

impl MultipleOf<Microsecond, i128> for Day

Source§

const VALUE: i128 = 86_400_000_000i128

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

impl MultipleOf<Microsecond, i64> for Day

Source§

const VALUE: i64 = 86_400_000_000i64

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

impl MultipleOf<Microsecond, u128> for Day

Source§

const VALUE: u128 = 86_400_000_000u128

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

impl MultipleOf<Microsecond, u64> for Day

Source§

const VALUE: u64 = 86_400_000_000u64

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

Source§

const VALUE: f64 = 8.64E+7f64

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, i32> for Day

Source§

const VALUE: i32 = 86_400_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, isize> for Day

Source§

const VALUE: isize = 86_400_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, u32> for Day

Source§

const VALUE: u32 = 86_400_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, usize> for Day

Source§

const VALUE: usize = 86_400_000usize

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

impl MultipleOf<Minute, f32> for Day

Source§

const VALUE: f32 = 1440f32

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

impl MultipleOf<Minute, f64> for Day

Source§

const VALUE: f64 = 1440f64

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

impl MultipleOf<Minute, i128> for Day

Source§

const VALUE: i128 = 1_440i128

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

impl MultipleOf<Minute, i16> for Day

Source§

const VALUE: i16 = 1_440i16

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

impl MultipleOf<Minute, i32> for Day

Source§

const VALUE: i32 = 1_440i32

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

impl MultipleOf<Minute, i64> for Day

Source§

const VALUE: i64 = 1_440i64

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

impl MultipleOf<Minute, isize> for Day

Source§

const VALUE: isize = 1_440isize

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

impl MultipleOf<Minute, u128> for Day

Source§

const VALUE: u128 = 1_440u128

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

impl MultipleOf<Minute, u16> for Day

Source§

const VALUE: u16 = 1_440u16

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

impl MultipleOf<Minute, u32> for Day

Source§

const VALUE: u32 = 1_440u32

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

impl MultipleOf<Minute, u64> for Day

Source§

const VALUE: u64 = 1_440u64

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

impl MultipleOf<Minute, usize> for Day

Source§

const VALUE: usize = 1_440usize

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

impl MultipleOf<Nanosecond, f32> for Day

Source§

const VALUE: f32 = 8.64000032E+13f32

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

impl MultipleOf<Nanosecond, f64> for Day

Source§

const VALUE: f64 = 8.64E+13f64

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

impl MultipleOf<Nanosecond, i128> for Day

Source§

const VALUE: i128 = 86_400_000_000_000i128

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

impl MultipleOf<Nanosecond, i64> for Day

Source§

const VALUE: i64 = 86_400_000_000_000i64

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

impl MultipleOf<Nanosecond, u128> for Day

Source§

const VALUE: u128 = 86_400_000_000_000u128

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

impl MultipleOf<Nanosecond, u64> for Day

Source§

const VALUE: u64 = 86_400_000_000_000u64

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

Source§

const VALUE: f64 = 86400f64

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, i32> for Day

Source§

const VALUE: i32 = 86_400i32

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

Source§

const VALUE: isize = 86_400isize

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, u32> for Day

Source§

const VALUE: u32 = 86_400u32

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

Source§

const VALUE: usize = 86_400usize

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

impl Copy for Day

Auto Trait Implementations§

§

impl Freeze for Day

§

impl RefUnwindSafe for Day

§

impl Send for Day

§

impl Sync for Day

§

impl Unpin for Day

§

impl UnwindSafe for Day

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.