pub struct Timestamp { /* private fields */ }Expand description
Nanosecond-precision monotonic timestamp.
Internally stores nanoseconds elapsed since an arbitrary monotonic origin.
Two Timestamp values from the same process can be subtracted; the result
is meaningful as a Duration. Do not compare values across processes.
Implementations§
Source§impl Timestamp
impl Timestamp
Sourcepub const fn new_from_nanos(n: i64) -> Self
pub const fn new_from_nanos(n: i64) -> Self
Construct from nanoseconds.
Sourcepub fn new_from_secs_f64(s: f64) -> Self
pub fn new_from_secs_f64(s: f64) -> Self
Construct from seconds (f64).
Trait Implementations§
Source§impl AddAssign for Timestamp
impl AddAssign for Timestamp
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+= operation. Read moreimpl Copy for Timestamp
impl Eq for Timestamp
Source§impl Ord for Timestamp
impl Ord for Timestamp
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
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for Timestamp
impl PartialOrd for Timestamp
impl StructuralPartialEq for Timestamp
Auto Trait Implementations§
impl Forget for Timestamp
impl Freeze for Timestamp
impl Move for Timestamp
impl RefUnwindSafe for Timestamp
impl Send for Timestamp
impl Sync for Timestamp
impl Unpin for Timestamp
impl UnsafeUnpin for Timestamp
impl UnwindSafe for Timestamp
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