pub struct Instant<T, U = NsUnit>(/* private fields */);
Expand description
A timestamp from the kernel. Generic over both the timeline and the units it is measured in.
Implementations§
source§impl Instant<MonotonicTimeline>
impl Instant<MonotonicTimeline>
sourcepub fn get() -> Self
pub fn get() -> Self
Get the current monotonic time which does not advance during system suspend.
Wraps the zx_clock_get_monotonic syscall.
sourcepub fn after(duration: MonotonicDuration) -> Self
pub fn after(duration: MonotonicDuration) -> Self
Compute a deadline for the time in the future that is the given Duration
away.
Wraps the zx_deadline_after syscall.
sourcepub fn sleep(self)
pub fn sleep(self)
Sleep until the given time.
Wraps the zx_nanosleep syscall.
source§impl Instant<BootTimeline>
impl Instant<BootTimeline>
sourcepub fn after(duration: BootDuration) -> Self
pub fn after(duration: BootDuration) -> Self
Compute a deadline for the time in the future that is the given Duration
away.
source§impl<T: Timeline> Instant<T>
impl<T: Timeline> Instant<T>
pub const INFINITE: Instant<T, NsUnit> = _
pub const INFINITE_PAST: Instant<T, NsUnit> = _
sourcepub const fn into_nanos(self) -> i64
pub const fn into_nanos(self) -> i64
Returns the number of nanoseconds since the epoch contained by this Time
.
sourcepub const fn from_nanos(nanos: i64) -> Self
pub const fn from_nanos(nanos: i64) -> Self
Return a strongly-typed Time
from a raw number of nanoseconds.
source§impl Instant<MonotonicTimeline, TicksUnit>
impl Instant<MonotonicTimeline, TicksUnit>
sourcepub fn get() -> Self
pub fn get() -> Self
Read the number of high-precision timer ticks on the monotonic timeline. These ticks may be processor cycles, high speed timer, profiling timer, etc. They do not advance while the system is suspended.
Wraps the zx_ticks_get syscall.
source§impl Instant<BootTimeline, TicksUnit>
impl Instant<BootTimeline, TicksUnit>
Trait Implementations§
source§impl<T: Timeline, U: TimeUnit> AddAssign<Duration<T, U>> for Instant<T, U>
impl<T: Timeline, U: TimeUnit> AddAssign<Duration<T, U>> for Instant<T, U>
source§fn add_assign(&mut self, dur: Duration<T, U>)
fn add_assign(&mut self, dur: Duration<T, U>)
+=
operation. Read moresource§impl<T, U> Ord for Instant<T, U>
impl<T, U> Ord for Instant<T, U>
source§impl<T, U> PartialEq for Instant<T, U>
impl<T, U> PartialEq for Instant<T, U>
source§impl<T, U> PartialOrd for Instant<T, U>
impl<T, U> PartialOrd for Instant<T, U>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl<T: Timeline, U: TimeUnit> SubAssign<Duration<T, U>> for Instant<T, U>
impl<T: Timeline, U: TimeUnit> SubAssign<Duration<T, U>> for Instant<T, U>
source§fn sub_assign(&mut self, dur: Duration<T, U>)
fn sub_assign(&mut self, dur: Duration<T, U>)
-=
operation. Read moreimpl<T, U> Copy for Instant<T, U>
impl<T, U> Eq for Instant<T, U>
Auto Trait Implementations§
impl<T, U> Freeze for Instant<T, U>
impl<T, U> RefUnwindSafe for Instant<T, U>where
T: RefUnwindSafe,
U: RefUnwindSafe,
impl<T, U> Send for Instant<T, U>
impl<T, U> Sync for Instant<T, U>
impl<T, U> Unpin for Instant<T, U>
impl<T, U> UnwindSafe for Instant<T, U>where
T: UnwindSafe,
U: UnwindSafe,
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)