pub struct Timestamp {
pub seconds: i64,
pub nanos: u32,
}Expand description
A moment in time as the API holds it: seconds and nanoseconds since 1970-01-01T00:00:00Z.
It prints as RFC 3339 (2026-10-06T09:30:00.25Z), orders by time, and comes from the
system’s clock with SystemTime::now().into(). A time crate takes the two fields:
jiff::Timestamp::new(t.seconds, t.nanos as i32),
chrono::DateTime::from_timestamp(t.seconds, t.nanos).
Fields§
§seconds: i64Whole seconds since 1970-01-01T00:00:00Z; negative before it.
nanos: u32Nanoseconds after seconds: 0 to 999,999,999.
Implementations§
Source§impl Timestamp
impl Timestamp
Sourcepub fn to_system_time(self) -> Option<SystemTime>
pub fn to_system_time(self) -> Option<SystemTime>
The same moment on the system’s clock. None = that clock cannot hold it, as Windows’
cannot a time before 1601.
Trait Implementations§
impl Copy for Timestamp
Source§impl<'de> Deserialize<'de> for Timestamp
From the API’s JSON. A field this version does not know is refused, as the API
refuses one it does not have.
impl<'de> Deserialize<'de> for Timestamp
From the API’s JSON. A field this version does not know is refused, as the API refuses one it does not have.
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
impl Eq for Timestamp
Source§impl From<SystemTime> for Timestamp
impl From<SystemTime> for Timestamp
Source§fn from(time: SystemTime) -> Self
fn from(time: SystemTime) -> Self
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,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for Timestamp
impl PartialOrd for Timestamp
Source§impl Serialize for Timestamp
As the API’s JSON: the proto’s field names, an enum as its value’s name, a 64-bit
integer as a string, a time as RFC 3339, bytes as base64.
impl Serialize for Timestamp
As the API’s JSON: the proto’s field names, an enum as its value’s name, a 64-bit integer as a string, a time as RFC 3339, bytes as base64.
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.