Struct tari_utilities::epoch_time::EpochTime
source · pub struct EpochTime(_);
Expand description
The timestamp, defined as the amount of seconds past from UNIX epoch.
Implementations§
source§impl EpochTime
impl EpochTime
sourcepub fn from_secs_since_epoch(secs: u64) -> EpochTime
pub fn from_secs_since_epoch(secs: u64) -> EpochTime
Creates a new EpochTime representing the number of seconds since the unix epoch (1970-01-01 00:00:00 UTC).
sourcepub fn increase(self, seconds: u64) -> EpochTime
pub fn increase(self, seconds: u64) -> EpochTime
Return a new EpochTime increased by the amount of seconds given.
Panics
It will panic if combined EpochTime and seconds are larger than U64::MAX.
sourcepub fn checked_add(self, other: EpochTime) -> Option<EpochTime>
pub fn checked_add(self, other: EpochTime) -> Option<EpochTime>
Checked EpochTime addition. Computes self + other, returning None if overflow occurred.
sourcepub fn checked_sub(self, other: EpochTime) -> Option<EpochTime>
pub fn checked_sub(self, other: EpochTime) -> Option<EpochTime>
Checked EpochTime subtraction. Computes self - other, returning None if overflow occurred.
Trait Implementations§
source§impl AddAssign<EpochTime> for EpochTime
impl AddAssign<EpochTime> for EpochTime
source§fn add_assign(&mut self, other: EpochTime)
fn add_assign(&mut self, other: EpochTime)
Performs the
+=
operation. Read moresource§impl<'de> Deserialize<'de> for EpochTime
impl<'de> Deserialize<'de> for EpochTime
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl DivAssign<u64> for EpochTime
impl DivAssign<u64> for EpochTime
source§fn div_assign(&mut self, other: u64)
fn div_assign(&mut self, other: u64)
Performs the
/=
operation. Read moresource§impl MulAssign<u64> for EpochTime
impl MulAssign<u64> for EpochTime
source§fn mul_assign(&mut self, other: u64)
fn mul_assign(&mut self, other: u64)
Performs the
*=
operation. Read moresource§impl Ord for EpochTime
impl Ord for EpochTime
source§impl PartialEq<EpochTime> for EpochTime
impl PartialEq<EpochTime> for EpochTime
source§impl PartialOrd<EpochTime> for EpochTime
impl PartialOrd<EpochTime> for EpochTime
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 RemAssign<u64> for EpochTime
impl RemAssign<u64> for EpochTime
source§fn rem_assign(&mut self, other: u64)
fn rem_assign(&mut self, other: u64)
Performs the
%=
operation. Read moresource§impl SubAssign<EpochTime> for EpochTime
impl SubAssign<EpochTime> for EpochTime
source§fn sub_assign(&mut self, other: EpochTime)
fn sub_assign(&mut self, other: EpochTime)
Performs the
-=
operation. Read moreimpl Copy for EpochTime
impl Eq for EpochTime
impl StructuralEq for EpochTime
impl StructuralPartialEq for EpochTime
Auto Trait Implementations§
impl RefUnwindSafe for EpochTime
impl Send for EpochTime
impl Sync for EpochTime
impl Unpin for EpochTime
impl UnwindSafe for EpochTime
Blanket Implementations§
source§impl<T> MessageFormat for Twhere
T: DeserializeOwned + Serialize,
impl<T> MessageFormat for Twhere T: DeserializeOwned + Serialize,
source§fn from_binary(msg: &[u8]) -> Result<T, MessageFormatError>
fn from_binary(msg: &[u8]) -> Result<T, MessageFormatError>
Convert from binary.
source§fn from_base64(msg: &str) -> Result<T, MessageFormatError>
fn from_base64(msg: &str) -> Result<T, MessageFormatError>
Convert from base64.