pub struct Instant(/* private fields */);Expand description
An instant in time.
This instant can be produced by Clock. Mixing instants from different clocks is not
supported and leads to undefined results but not undefined behaviour.
Implementations§
Source§impl Instant
impl Instant
Sourcepub fn from_duration(duration: Duration) -> Self
pub fn from_duration(duration: Duration) -> Self
Creates a new Instant from a duration.
The meaning of the duration is up to the caller, usually a specific Clock.
For example a system clock may take offsets from a specific std::time::Instant,
a CPU time measurement may use a duration representing the amount of nano seconds
passed since the start of the task.
Trait Implementations§
impl Copy for Instant
impl Eq for Instant
Source§impl Ord for Instant
impl Ord for Instant
1.21.0 (const: unstable) · 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 PartialOrd for Instant
impl PartialOrd 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 UnsafeUnpin 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