pub struct Instant(/* private fields */);
Expand description
Some instant in time, ever increasing but able to be manipulated. The manipulations carries a risk of over/underflow,
Implementations§
Source§impl Instant
impl Instant
pub fn now() -> Self
Sourcepub fn elapsed(self) -> Option<Duration>
pub fn elapsed(self) -> Option<Duration>
Get the time that has passed since this instant.
If this Instant
is by some manipulation after now
, returns None
Sourcepub fn duration_since(self, other: Self) -> Option<Duration>
pub fn duration_since(self, other: Self) -> Option<Duration>
Get the duration since some other Instant
.
If this Instant
is before other
in monotonic time, returns None
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