Struct tari_utilities::epoch_time::EpochTime
source · pub struct EpochTime(/* private fields */);
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 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<'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 Ord for EpochTime
impl Ord for EpochTime
source§impl PartialEq for EpochTime
impl PartialEq for EpochTime
source§impl PartialOrd for EpochTime
impl PartialOrd 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 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> 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
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.