Struct fuchsia_async::Time
source · pub struct Time(/* private fields */);
Expand description
A time relative to the executor’s clock.
Implementations§
source§impl Time
impl Time
sourcepub fn now() -> Self
pub fn now() -> Self
Return the current time according to the global executor.
This function requires that an executor has been set up.
sourcepub fn after(duration: Duration) -> Self
pub fn after(duration: Duration) -> Self
Compute a deadline for the time in the future that is the
given Duration
away. Similarly to zx::Time::after
,
saturates on overflow instead of wrapping around.
This function requires that an executor has been set up.
sourcepub const fn from_zx(t: Time) -> Self
pub const fn from_zx(t: Time) -> Self
Convert from zx::Time
. This only makes sense if the time is
taken from the same source (for the real clock, this is
zx::ClockId::Monotonic
).
sourcepub const fn into_zx(self) -> Time
pub const fn into_zx(self) -> Time
Convert into zx::Time
. For the real clock, this will be a
monotonic time.
sourcepub const fn from_nanos(nanos: i64) -> Self
pub const fn from_nanos(nanos: i64) -> Self
Convert from nanoseconds.
sourcepub const fn into_nanos(self) -> i64
pub const fn into_nanos(self) -> i64
Convert to nanoseconds.
sourcepub const INFINITE_PAST: Time = _
pub const INFINITE_PAST: Time = _
The minimum time.
Trait Implementations§
source§impl AddAssign<Duration> for Time
impl AddAssign<Duration> for Time
source§fn add_assign(&mut self, d: Duration)
fn add_assign(&mut self, d: Duration)
Performs the
+=
operation. Read moresource§impl Ord for Time
impl Ord for Time
source§impl PartialEq for Time
impl PartialEq for Time
source§impl PartialOrd for Time
impl PartialOrd for Time
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl SubAssign<Duration> for Time
impl SubAssign<Duration> for Time
source§fn sub_assign(&mut self, d: Duration)
fn sub_assign(&mut self, d: Duration)
Performs the
-=
operation. Read moresource§impl WakeupTime for Time
impl WakeupTime for Time
impl Copy for Time
impl Eq for Time
impl StructuralEq for Time
impl StructuralPartialEq for Time
Auto Trait Implementations§
impl RefUnwindSafe for Time
impl Send for Time
impl Sync for Time
impl Unpin for Time
impl UnwindSafe for Time
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