Struct Nanosecond

struct Nanosecond

A unit of time representing exactly one nanosecond.

Implementations

impl Nanosecond

const fn per<T>(_larger: T) -> <T as DefaultOutput<Self>>::Output
where
    T: MultipleOf<Self, <T as >::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)
const fn per_t<Output, impl MultipleOf<Self, Output> + Copy: MultipleOf<Self, Output> + Copy>(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)

impl Clone for Nanosecond

fn clone(self: &Self) -> Nanosecond

impl Copy for Nanosecond

impl Debug for Nanosecond

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

impl Freeze for Nanosecond

impl RefUnwindSafe for Nanosecond

impl Send for Nanosecond

impl Sync for Nanosecond

impl Unpin for Nanosecond

impl UnsafeUnpin for Nanosecond

impl UnwindSafe for Nanosecond

impl<T> Any for Nanosecond

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for Nanosecond

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for Nanosecond

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

impl<T> CloneToUninit for Nanosecond

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

impl<T> From for Nanosecond

fn from(t: T) -> T

Returns the argument unchanged.

impl<T, U> Into for Nanosecond

fn into(self: Self) -> U

Calls U::from(self).

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

impl<T, U> TryFrom for Nanosecond

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

impl<T, U> TryInto for Nanosecond

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