pub struct Timestamp(/* private fields */);Expand description
A UTC instant represented as microseconds since the Unix epoch.
The representation is independent of SQLite and has sufficient precision for filesystem and domain bookkeeping without exposing a third-party time type.
Implementations§
Source§impl Timestamp
impl Timestamp
Sourcepub const fn from_unix_micros(micros: i64) -> Self
pub const fn from_unix_micros(micros: i64) -> Self
Creates a timestamp from signed Unix microseconds.
Sourcepub const fn as_unix_micros(self) -> i64
pub const fn as_unix_micros(self) -> i64
Returns the signed Unix-microsecond representation.
Sourcepub fn now() -> Result<Self>
pub fn now() -> Result<Self>
Reads the current system time.
§Errors
Returns ErrorKind::Internal if the platform clock predates the Unix
epoch or cannot be represented in signed microseconds.
Trait Implementations§
impl Copy for Timestamp
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