pub struct Timestamp(_);
Expand description
UNIX timestamp which helps working with absolute time.
Implementations§
source§impl Timestamp
impl Timestamp
sourcepub fn from_secs(secs: u64) -> Timestamp
pub fn from_secs(secs: u64) -> Timestamp
Constructs timestamp from a given number of seconds since SystemTime::UNIX_EPOCH
.
sourcepub fn from_millis(millis: u128) -> Timestamp
pub fn from_millis(millis: u128) -> Timestamp
Constructs timestamp from a given number of milliseconds since SystemTime::UNIX_EPOCH
.
Trait Implementations§
source§impl AddAssign<Duration> for Timestamp
impl AddAssign<Duration> for Timestamp
source§fn add_assign(&mut self, rhs: Duration)
fn add_assign(&mut self, rhs: Duration)
Performs the
+=
operation. Read moresource§impl AddAssign<Timestamp> for Timestamp
impl AddAssign<Timestamp> for Timestamp
source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+=
operation. Read moresource§impl Ord for Timestamp
impl Ord for Timestamp
source§impl PartialEq<Timestamp> for Timestamp
impl PartialEq<Timestamp> for Timestamp
source§impl PartialOrd<Timestamp> for Timestamp
impl PartialOrd<Timestamp> 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 moresource§impl SubAssign<Duration> for Timestamp
impl SubAssign<Duration> for Timestamp
source§fn sub_assign(&mut self, rhs: Duration)
fn sub_assign(&mut self, rhs: Duration)
Performs the
-=
operation. Read moresource§impl SubAssign<Timestamp> for Timestamp
impl SubAssign<Timestamp> for Timestamp
source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-=
operation. Read moresource§impl Wrapper for Timestamp
impl Wrapper for Timestamp
source§fn from_inner(inner: Self::Inner) -> Self
fn from_inner(inner: Self::Inner) -> Self
Instantiates wrapper type with the inner data
source§fn as_inner(&self) -> &Self::Inner
fn as_inner(&self) -> &Self::Inner
Returns reference to the inner representation for the wrapper type
source§fn into_inner(self) -> Self::Inner
fn into_inner(self) -> Self::Inner
Unwraps the wrapper returning the inner type
source§impl WrapperMut for Timestamp
impl WrapperMut for Timestamp
source§fn as_inner_mut(&mut self) -> &mut <Self as Wrapper>::Inner
fn as_inner_mut(&mut self) -> &mut <Self as Wrapper>::Inner
Returns a mutable reference to the inner representation for the wrapper
type