pub struct MonotonicInstant(/* private fields */);
Expand description
A time relative to the executor’s clock.
Implementations§
Source§impl MonotonicInstant
impl MonotonicInstant
Sourcepub const INFINITE: MonotonicInstant = _
pub const INFINITE: MonotonicInstant = _
The maximum time.
Sourcepub const INFINITE_PAST: MonotonicInstant = _
pub const INFINITE_PAST: MonotonicInstant = _
The minimum 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: MonotonicDuration) -> Self
pub fn after(duration: MonotonicDuration) -> Self
Compute a deadline for the time in the future that is the
given Duration
away. Similarly to zx::MonotonicInstant::after
,
saturates on overflow instead of wrapping around.
This function requires that an executor has been set up.
Sourcepub const fn from_zx(t: MonotonicInstant) -> Self
pub const fn from_zx(t: MonotonicInstant) -> Self
Convert from zx::MonotonicInstant
.
Sourcepub const fn into_zx(self) -> MonotonicInstant
pub const fn into_zx(self) -> MonotonicInstant
Convert into zx::MonotonicInstant
.
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.
Trait Implementations§
Source§impl Add<Duration<MonotonicTimeline>> for MonotonicInstant
impl Add<Duration<MonotonicTimeline>> for MonotonicInstant
Source§type Output = MonotonicInstant
type Output = MonotonicInstant
The resulting type after applying the
+
operator.Source§fn add(self, d: MonotonicDuration) -> MonotonicInstant
fn add(self, d: MonotonicDuration) -> MonotonicInstant
Performs the
+
operation. Read moreSource§impl Add<MonotonicInstant> for MonotonicDuration
impl Add<MonotonicInstant> for MonotonicDuration
Source§type Output = MonotonicInstant
type Output = MonotonicInstant
The resulting type after applying the
+
operator.Source§fn add(self, t: MonotonicInstant) -> MonotonicInstant
fn add(self, t: MonotonicInstant) -> MonotonicInstant
Performs the
+
operation. Read moreSource§impl AddAssign<Duration<MonotonicTimeline>> for MonotonicInstant
impl AddAssign<Duration<MonotonicTimeline>> for MonotonicInstant
Source§fn add_assign(&mut self, d: MonotonicDuration)
fn add_assign(&mut self, d: MonotonicDuration)
Performs the
+=
operation. Read moreSource§impl Clone for MonotonicInstant
impl Clone for MonotonicInstant
Source§fn clone(&self) -> MonotonicInstant
fn clone(&self) -> MonotonicInstant
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for MonotonicInstant
impl Debug for MonotonicInstant
Source§impl From<Instant<MonotonicTimeline>> for MonotonicInstant
impl From<Instant<MonotonicTimeline>> for MonotonicInstant
Source§fn from(t: MonotonicInstant) -> MonotonicInstant
fn from(t: MonotonicInstant) -> MonotonicInstant
Converts to this type from the input type.
Source§impl From<MonotonicInstant> for MonotonicInstant
impl From<MonotonicInstant> for MonotonicInstant
Source§fn from(t: MonotonicInstant) -> MonotonicInstant
fn from(t: MonotonicInstant) -> MonotonicInstant
Converts to this type from the input type.
Source§impl Hash for MonotonicInstant
impl Hash for MonotonicInstant
Source§impl Ord for MonotonicInstant
impl Ord for MonotonicInstant
Source§fn cmp(&self, other: &MonotonicInstant) -> Ordering
fn cmp(&self, other: &MonotonicInstant) -> Ordering
1.21.0 · 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
Source§impl PartialEq for MonotonicInstant
impl PartialEq for MonotonicInstant
Source§impl PartialOrd for MonotonicInstant
impl PartialOrd for MonotonicInstant
Source§impl Sub<Duration<MonotonicTimeline>> for MonotonicInstant
impl Sub<Duration<MonotonicTimeline>> for MonotonicInstant
Source§type Output = MonotonicInstant
type Output = MonotonicInstant
The resulting type after applying the
-
operator.Source§fn sub(self, d: MonotonicDuration) -> MonotonicInstant
fn sub(self, d: MonotonicDuration) -> MonotonicInstant
Performs the
-
operation. Read moreSource§impl Sub for MonotonicInstant
impl Sub for MonotonicInstant
Source§type Output = Duration<MonotonicTimeline>
type Output = Duration<MonotonicTimeline>
The resulting type after applying the
-
operator.Source§fn sub(self, t: MonotonicInstant) -> MonotonicDuration
fn sub(self, t: MonotonicInstant) -> MonotonicDuration
Performs the
-
operation. Read moreSource§impl SubAssign<Duration<MonotonicTimeline>> for MonotonicInstant
impl SubAssign<Duration<MonotonicTimeline>> for MonotonicInstant
Source§fn sub_assign(&mut self, d: MonotonicDuration)
fn sub_assign(&mut self, d: MonotonicDuration)
Performs the
-=
operation. Read moreSource§impl WakeupTime for MonotonicInstant
impl WakeupTime for MonotonicInstant
impl Copy for MonotonicInstant
impl Eq for MonotonicInstant
impl StructuralPartialEq for MonotonicInstant
Auto Trait Implementations§
impl Freeze for MonotonicInstant
impl RefUnwindSafe for MonotonicInstant
impl Send for MonotonicInstant
impl Sync for MonotonicInstant
impl Unpin for MonotonicInstant
impl UnwindSafe for MonotonicInstant
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)