pub struct MonotonicClock(/* private fields */);Expand description
A reference to a monotonically nondecreasing clock.
This does not directly correspond to anything in std, however its methods
correspond to methods in std::time::Instant.
Implementations§
Source§impl MonotonicClock
impl MonotonicClock
Sourcepub const fn new(ambient_authority: AmbientAuthority) -> MonotonicClock
pub const fn new(ambient_authority: AmbientAuthority) -> MonotonicClock
Constructs a new instance of Self.
§Ambient Authority
This uses ambient authority to accesses clocks.
Sourcepub fn now(&self) -> Instant
pub fn now(&self) -> Instant
Returns an instant corresponding to “now”.
This corresponds to std::time::Instant::now.
Sourcepub fn elapsed(&self, instant: Instant) -> Duration
pub fn elapsed(&self, instant: Instant) -> Duration
Returns the amount of time elapsed since this instant was created.
This corresponds to std::time::Instant::elapsed.
Auto Trait Implementations§
impl Freeze for MonotonicClock
impl RefUnwindSafe for MonotonicClock
impl Send for MonotonicClock
impl Sync for MonotonicClock
impl Unpin for MonotonicClock
impl UnsafeUnpin for MonotonicClock
impl UnwindSafe for MonotonicClock
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