pub struct Timestamp(_);Expand description
A timestamp
Implementations
sourceimpl Timestamp
impl Timestamp
pub const fn new(inner: OffsetDateTime) -> Self
pub const fn to_inner(self) -> OffsetDateTime
pub const fn to_utc(self) -> Self
sourcepub fn now() -> Self
pub fn now() -> Self
Current system time with offset
Tries to obtain the current system time with the local time zone offset. Returns an UTC timestamp as a fallback if the local time zone is unknown or could not be determined.
Prefer to use [now_utc()] if the local time zone offset doesn’t
matter.
pub fn parse_rfc3339(input: &str) -> Result<Self, Parse>
pub fn format_rfc3339(&self) -> Result<String, Format>
pub fn format_rfc3339_into<W: Write>(
&self,
output: &mut W
) -> Result<usize, Format>
Methods from Deref<Target = OffsetDateTime>
pub const UNIX_EPOCH: OffsetDateTime
Trait Implementations
sourceimpl AddAssign<Interval> for Timestamp
impl AddAssign<Interval> for Timestamp
sourcefn add_assign(&mut self, interval: Interval)
fn add_assign(&mut self, interval: Interval)
Performs the += operation. Read more
sourceimpl AsRef<OffsetDateTime> for Timestamp
impl AsRef<OffsetDateTime> for Timestamp
sourcefn as_ref(&self) -> &OffsetDateTime
fn as_ref(&self) -> &OffsetDateTime
Performs the conversion.
sourceimpl Deref for Timestamp
impl Deref for Timestamp
type Target = OffsetDateTime
type Target = OffsetDateTime
The resulting type after dereferencing.
sourcefn deref(&self) -> &OffsetDateTime
fn deref(&self) -> &OffsetDateTime
Dereferences the value.
sourceimpl From<OffsetDateTime> for Timestamp
impl From<OffsetDateTime> for Timestamp
sourcefn from(inner: OffsetDateTime) -> Self
fn from(inner: OffsetDateTime) -> Self
Performs the conversion.
sourceimpl From<SystemTime> for Timestamp
impl From<SystemTime> for Timestamp
sourcefn from(system_time: SystemTime) -> Self
fn from(system_time: SystemTime) -> Self
Performs the conversion.
sourceimpl From<Timestamp> for OffsetDateTime
impl From<Timestamp> for OffsetDateTime
sourceimpl From<Timestamp> for SystemTime
impl From<Timestamp> for SystemTime
sourceimpl Ord for Timestamp
impl Ord for Timestamp
sourceimpl PartialOrd<Timestamp> for Timestamp
impl PartialOrd<Timestamp> for Timestamp
sourcefn partial_cmp(&self, other: &Timestamp) -> Option<Ordering>
fn partial_cmp(&self, other: &Timestamp) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
sourceimpl SubAssign<Interval> for Timestamp
impl SubAssign<Interval> for Timestamp
sourcefn sub_assign(&mut self, interval: Interval)
fn sub_assign(&mut self, interval: Interval)
Performs the -= operation. Read more
impl Copy for Timestamp
impl Eq for Timestamp
impl StructuralEq for Timestamp
impl StructuralPartialEq for Timestamp
Auto Trait Implementations
impl RefUnwindSafe for Timestamp
impl Send for Timestamp
impl Sync for Timestamp
impl Unpin for Timestamp
impl UnwindSafe for Timestamp
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more