pub struct Timestamp(/* private fields */);Expand description
A point in time as milliseconds since an epoch the runtime chooses. This is a
pure value: the core names time but never reads it. There is deliberately no
now constructor — a runtime obtains the current time and injects it, keeping
lease decisions deterministic and testable.
Implementations§
Source§impl Timestamp
impl Timestamp
Sourcepub fn from_millis(millis: u64) -> Self
pub fn from_millis(millis: u64) -> Self
Build a timestamp from milliseconds since the runtime’s chosen epoch.
Sourcepub fn plus_millis(self, millis: u64) -> Self
pub fn plus_millis(self, millis: u64) -> Self
The timestamp millis milliseconds after this one, saturating at the maximum.
Trait Implementations§
impl Copy for Timestamp
Source§impl<'de> Deserialize<'de> for Timestamp
impl<'de> Deserialize<'de> for Timestamp
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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
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