pub struct Timestamp(/* private fields */);Expand description
Signed Unix-millisecond timestamp, including instants before 1970. Sub-millisecond conversions floor; arithmetic operators saturate only after the complete wide operation. This value never reads the clock.
Implementations§
Source§impl Timestamp
impl Timestamp
Sourcepub const fn from_millis(millis: i64) -> Self
pub const fn from_millis(millis: i64) -> Self
Construct from milliseconds.
Sourcepub const fn try_from_i64(millis: i64) -> Option<Self>
pub const fn try_from_i64(millis: i64) -> Option<Self>
Convert signed milliseconds.
Sourcepub fn try_from_u64(millis: u64) -> Option<Self>
pub fn try_from_u64(millis: u64) -> Option<Self>
Convert unsigned milliseconds.
Sourcepub const fn from_micros(micros: i64) -> Self
pub const fn from_micros(micros: i64) -> Self
Construct from microseconds, flooring to Unix milliseconds.
Sourcepub const fn from_nanos(nanos: i64) -> Self
pub const fn from_nanos(nanos: i64) -> Self
Construct from nanoseconds, flooring to Unix milliseconds.
Sourcepub fn parse_rfc3339(input: &str) -> Result<Self, TimeParseError>
pub fn parse_rfc3339(input: &str) -> Result<Self, TimeParseError>
Parse strict RFC3339 text.
§Errors
Returns TimeParseError::InvalidTimestamp for malformed or
out-of-range input.
Sourcepub fn parse_flexible(input: &str) -> Result<Self, TimeParseError>
pub fn parse_flexible(input: &str) -> Result<Self, TimeParseError>
Trait Implementations§
Source§impl AddAssign<Duration> for Timestamp
impl AddAssign<Duration> for Timestamp
Source§fn add_assign(&mut self, duration: Duration)
fn add_assign(&mut self, duration: Duration)
Performs the
+= operation. Read moreimpl Copy for Timestamp
impl Eq for Timestamp
Source§impl From<Timestamp> for IndexValue<'_>
impl From<Timestamp> for IndexValue<'_>
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 Forget for Timestamp
impl Freeze for Timestamp
impl Move 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