Struct ofdb_entities::time::Timestamp
source · pub struct Timestamp(/* private fields */);
Expand description
A primitive unix timestamp without time zone.
We assume that all timestamps must be specified in the UTC time zone.
Implementations§
source§impl Timestamp
impl Timestamp
pub fn now() -> Self
pub fn try_from_secs(seconds: i64) -> Result<Self, OutOfRangeError>
pub fn from_secs(seconds: i64) -> Self
👎Deprecated
pub fn try_from_millis(milliseconds: i64) -> Result<Self, OutOfRangeError>
pub fn from_millis(milliseconds: i64) -> Self
👎Deprecated
pub fn as_secs(self) -> i64
pub fn as_millis(self) -> i64
pub fn format(&self, fmt: &[FormatItem<'_>]) -> String
pub fn checked_sub(self, duration: Duration) -> Option<Self>
Trait Implementations§
source§impl From<PrimitiveDateTime> for Timestamp
impl From<PrimitiveDateTime> for Timestamp
source§fn from(ts: PrimitiveDateTime) -> Self
fn from(ts: PrimitiveDateTime) -> Self
Converts to this type from the input type.
source§impl Ord for Timestamp
impl Ord for Timestamp
source§impl PartialEq for Timestamp
impl PartialEq for Timestamp
source§impl PartialOrd for Timestamp
impl PartialOrd for Timestamp
1.0.0 · source§fn 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 moreimpl 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§
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