pub struct Timestamp(/* private fields */);Expand description
A UTC timestamp serialised as RFC 3339.
Wraps a time::OffsetDateTime and forces serde to round-trip through
the RFC 3339 string form, so every encoded Timestamp on the wire and on
disk looks the same regardless of which subsystem produced it.
Implementations§
Source§impl Timestamp
impl Timestamp
Sourcepub const fn from_offset_date_time(value: OffsetDateTime) -> Self
pub const fn from_offset_date_time(value: OffsetDateTime) -> Self
Build a Timestamp from an existing OffsetDateTime.
The wrapped value is preserved verbatim; no timezone conversion is applied. Callers who want UTC normalisation should convert before passing the value in.
Sourcepub const fn into_inner(self) -> OffsetDateTime
pub const fn into_inner(self) -> OffsetDateTime
Consume the wrapper and return the underlying OffsetDateTime.
Sourcepub const fn as_offset_date_time(&self) -> &OffsetDateTime
pub const fn as_offset_date_time(&self) -> &OffsetDateTime
Borrow the underlying OffsetDateTime.
Trait Implementations§
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
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 Copy for Timestamp
impl Eq 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