pub struct Timestamp(/* private fields */);Expand description
Monotonic time measured from an application-defined epoch.
The framework never reads a system clock. Callers can therefore use a hardware timer, an event-loop clock, or deterministic values in tests.
Implementations§
Source§impl Timestamp
impl Timestamp
pub const ZERO: Self
pub const fn from_duration(value: Duration) -> Self
pub const fn from_millis(value: u64) -> Self
pub const fn from_micros(value: u64) -> Self
pub const fn as_duration(self) -> Duration
pub fn checked_add(self, duration: Duration) -> Option<Self>
pub fn saturating_add(self, duration: Duration) -> Self
pub fn checked_duration_since(self, earlier: Self) -> Option<Duration>
Trait Implementations§
impl 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 Freeze 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