pub struct Instant(/* private fields */);
Expand description
Analogous to the standard library Instant
type, representing a point in
time.
Implementations§
Source§impl Instant
impl Instant
Sourcepub const fn reference() -> Instant
pub const fn reference() -> Instant
An arbitrary point in time to use as a starting point for other
instances of Instant
.
Generally intended to be used once in the platform implementation. Use
Platform::now
to get the current point in
time.
Sourcepub fn duration_since(self, past_instant: Instant) -> Option<Duration>
pub fn duration_since(self, past_instant: Instant) -> Option<Duration>
Returns the duration from past_instant
to self
.
Returns None if past_instant
is after self
.
Trait Implementations§
Source§impl Ord for Instant
impl Ord for Instant
Source§impl PartialOrd for Instant
impl PartialOrd for Instant
impl Copy for Instant
impl Eq for Instant
impl StructuralPartialEq for Instant
Auto Trait Implementations§
impl Freeze for Instant
impl RefUnwindSafe for Instant
impl Send for Instant
impl Sync for Instant
impl Unpin for Instant
impl UnwindSafe for Instant
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