pub struct Instant<C: ClockId, U: InstantUnit = Nsec> { /* private fields */ }Expand description
A specific point in time.
The time is read from the clock given by the type parameter C (see
ClockId) and stored in the unit given by U (see InstantUnit); its
value has type U::Repr. U defaults to Nsec, so a plain
Instant<C> is a point in time in nanoseconds.
§Invariants
- For
U = Nsec, theinnervalue is in the range from 0 toKTIME_MAX. - For
U = Sec, theinnervalue is in the range from 0 toKTIME_SEC_MAX.
Implementations§
Trait Implementations§
impl<C: ClockId, U: InstantUnit> Copy for Instant<C, U>
impl<C: Eq + ClockId, U: Eq + InstantUnit> Eq for Instant<C, U>
Source§impl<C: ClockId> HrTimerExpires for Instant<C>
impl<C: ClockId> HrTimerExpires for Instant<C>
Source§impl<C: Ord + ClockId, U: Ord + InstantUnit> Ord for Instant<C, U>
impl<C: Ord + ClockId, U: Ord + InstantUnit> Ord for Instant<C, U>
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl<C: PartialOrd + ClockId, U: PartialOrd + InstantUnit> PartialOrd for Instant<C, U>where
U::Repr: PartialOrd,
impl<C: PartialOrd + ClockId, U: PartialOrd + InstantUnit> PartialOrd for Instant<C, U>where
U::Repr: PartialOrd,
impl<C: PartialEq + ClockId, U: PartialEq + InstantUnit> StructuralPartialEq for Instant<C, U>
Auto Trait Implementations§
impl<C, U> Forget for Instant<C, U>
impl<C, U> Freeze for Instant<C, U>
impl<C, U> Move for Instant<C, U>
impl<C, U> RefUnwindSafe for Instant<C, U>
impl<C, U> Send for Instant<C, U>
impl<C, U> Sync for Instant<C, U>
impl<C, U> Unpin for Instant<C, U>
impl<C, U> UnsafeUnpin for Instant<C, U>
impl<C, U> UnwindSafe for Instant<C, U>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<S, T> IntoSafeCast<T> for Swhere
T: FromSafeCast<S>,
impl<S, T> IntoSafeCast<T> for Swhere
T: FromSafeCast<S>,
Source§fn into_safe_cast(self) -> T
fn into_safe_cast(self) -> T
Convert
self into a T. This operation is guaranteed to be lossless.Source§impl<S, T> IntoSafeCastArch<T> for Swhere
T: FromSafeCastArch<S>,
impl<S, T> IntoSafeCastArch<T> for Swhere
T: FromSafeCastArch<S>,
Source§fn into_safe_cast_arch(self) -> T
fn into_safe_cast_arch(self) -> T
Convert
self into a T. This operation is guaranteed to be lossless.