pub struct UnixTime(/* private fields */);Expand description
A point in time as whole seconds since the Unix epoch.
This crate never reads a clock; callers pass the current time in.
§Examples
use std::time::Duration;
use stratum_node_core::UnixTime;
let now = UnixTime::from_secs(1_700_000_000);
let later = now.checked_add(Duration::from_secs(300));
assert_eq!(later, Some(UnixTime::from_secs(1_700_000_300)));Implementations§
Trait Implementations§
impl Copy for UnixTime
Source§impl<'de> Deserialize<'de> for UnixTime
impl<'de> Deserialize<'de> for UnixTime
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
impl Eq for UnixTime
Source§impl Ord for UnixTime
impl Ord for UnixTime
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
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for UnixTime
impl PartialOrd for UnixTime
impl StructuralPartialEq for UnixTime
Auto Trait Implementations§
impl Forget for UnixTime
impl Freeze for UnixTime
impl Move for UnixTime
impl RefUnwindSafe for UnixTime
impl Send for UnixTime
impl Sync for UnixTime
impl Unpin for UnixTime
impl UnsafeUnpin for UnixTime
impl UnwindSafe for UnixTime
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