Struct Nanosecond

Source
pub struct Nanosecond;
Expand description

A unit of time representing exactly one nanosecond.

Implementations§

Source§

impl Nanosecond

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

Valid calls:

  • Nanosecond::per(Nanosecond) (returns u8)
  • Nanosecond::per(Microsecond) (returns u16)
  • Nanosecond::per(Millisecond) (returns u32)
  • Nanosecond::per(Second) (returns u32)
  • Nanosecond::per(Minute) (returns u64)
  • Nanosecond::per(Hour) (returns u64)
  • Nanosecond::per(Day) (returns u64)
  • Nanosecond::per(Week) (returns u64)
Source

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

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

Valid calls:

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

Trait Implementations§

Source§

impl Clone for Nanosecond

Source§

fn clone(&self) -> Nanosecond

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 Nanosecond

Source§

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

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

impl DefaultOutput<Nanosecond> for Day

Source§

impl DefaultOutput<Nanosecond> for Hour

Source§

impl DefaultOutput<Nanosecond> for Microsecond

Source§

impl DefaultOutput<Nanosecond> for Millisecond

Source§

impl DefaultOutput<Nanosecond> for Minute

Source§

impl DefaultOutput<Nanosecond> for Nanosecond

Source§

impl DefaultOutput<Nanosecond> for Second

Source§

impl DefaultOutput<Nanosecond> for Week

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, f32> for Hour

Source§

const VALUE: f32 = 3.59999996E+12f32

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

impl MultipleOf<Nanosecond, f32> for Microsecond

Source§

const VALUE: f32 = 1000f32

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, f32> for Minute

Source§

const VALUE: f32 = 6.0000002E+10f32

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

impl MultipleOf<Nanosecond, f32> for Nanosecond

Source§

const VALUE: f32 = 1f32

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, f32> for Week

Source§

const VALUE: f32 = 6.0479998E+14f32

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

Source§

const VALUE: f64 = 3.6E+12f64

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

impl MultipleOf<Nanosecond, f64> for Microsecond

Source§

const VALUE: f64 = 1000f64

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

Source§

const VALUE: f64 = 6.0E+10f64

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

impl MultipleOf<Nanosecond, f64> for Nanosecond

Source§

const VALUE: f64 = 1f64

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

Source§

const VALUE: f64 = 6.048E+14f64

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, i128> for Hour

Source§

const VALUE: i128 = 3_600_000_000_000i128

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

impl MultipleOf<Nanosecond, i128> for Microsecond

Source§

const VALUE: i128 = 1_000i128

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, i128> for Minute

Source§

const VALUE: i128 = 60_000_000_000i128

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

impl MultipleOf<Nanosecond, i128> for Nanosecond

Source§

const VALUE: i128 = 1i128

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, i128> for Week

Source§

const VALUE: i128 = 604_800_000_000_000i128

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

impl MultipleOf<Nanosecond, i16> for Microsecond

Source§

const VALUE: i16 = 1_000i16

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

impl MultipleOf<Nanosecond, i16> for Nanosecond

Source§

const VALUE: i16 = 1i16

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

impl MultipleOf<Nanosecond, i32> for Microsecond

Source§

const VALUE: i32 = 1_000i32

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

Source§

const VALUE: i32 = 1i32

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 Day

Source§

const VALUE: i64 = 86_400_000_000_000i64

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

impl MultipleOf<Nanosecond, i64> for Hour

Source§

const VALUE: i64 = 3_600_000_000_000i64

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

impl MultipleOf<Nanosecond, i64> for Microsecond

Source§

const VALUE: i64 = 1_000i64

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, i64> for Minute

Source§

const VALUE: i64 = 60_000_000_000i64

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

impl MultipleOf<Nanosecond, i64> for Nanosecond

Source§

const VALUE: i64 = 1i64

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, i64> for Week

Source§

const VALUE: i64 = 604_800_000_000_000i64

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

impl MultipleOf<Nanosecond, i8> for Nanosecond

Source§

const VALUE: i8 = 1i8

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

impl MultipleOf<Nanosecond, isize> for Microsecond

Source§

const VALUE: isize = 1_000isize

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

Source§

const VALUE: isize = 1isize

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 Day

Source§

const VALUE: u128 = 86_400_000_000_000u128

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

impl MultipleOf<Nanosecond, u128> for Hour

Source§

const VALUE: u128 = 3_600_000_000_000u128

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

impl MultipleOf<Nanosecond, u128> for Microsecond

Source§

const VALUE: u128 = 1_000u128

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, u128> for Minute

Source§

const VALUE: u128 = 60_000_000_000u128

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

impl MultipleOf<Nanosecond, u128> for Nanosecond

Source§

const VALUE: u128 = 1u128

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, u128> for Week

Source§

const VALUE: u128 = 604_800_000_000_000u128

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

impl MultipleOf<Nanosecond, u16> for Microsecond

Source§

const VALUE: u16 = 1_000u16

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

impl MultipleOf<Nanosecond, u16> for Nanosecond

Source§

const VALUE: u16 = 1u16

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

impl MultipleOf<Nanosecond, u32> for Microsecond

Source§

const VALUE: u32 = 1_000u32

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

Source§

const VALUE: u32 = 1u32

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 Day

Source§

const VALUE: u64 = 86_400_000_000_000u64

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

impl MultipleOf<Nanosecond, u64> for Hour

Source§

const VALUE: u64 = 3_600_000_000_000u64

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

impl MultipleOf<Nanosecond, u64> for Microsecond

Source§

const VALUE: u64 = 1_000u64

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, u64> for Minute

Source§

const VALUE: u64 = 60_000_000_000u64

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

impl MultipleOf<Nanosecond, u64> for Nanosecond

Source§

const VALUE: u64 = 1u64

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, u64> for Week

Source§

const VALUE: u64 = 604_800_000_000_000u64

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

impl MultipleOf<Nanosecond, u8> for Nanosecond

Source§

const VALUE: u8 = 1u8

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

impl MultipleOf<Nanosecond, usize> for Microsecond

Source§

const VALUE: usize = 1_000usize

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 MultipleOf<Nanosecond, usize> for Nanosecond

Source§

const VALUE: usize = 1usize

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 Copy for Nanosecond

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.