pub struct UnixTime(/* private fields */);
Expand description
A timestamp, tracking the number of non-leap seconds since the Unix epoch.
The Unix epoch is defined January 1, 1970 00:00:00 UTC.
Implementations§
source§impl UnixTime
impl UnixTime
sourcepub fn now() -> Self
Available on crate feature std
and not (target_family="wasm"
and target_os="unknown"
), or target_family="wasm"
and target_os="unknown"
and crate feature web
only.
pub fn now() -> Self
std
and not (target_family="wasm"
and target_os="unknown"
), or target_family="wasm"
and target_os="unknown"
and crate feature web
only.The current time, as a UnixTime
sourcepub fn since_unix_epoch(duration: Duration) -> Self
pub fn since_unix_epoch(duration: Duration) -> Self
Convert a Duration
since the start of 1970 to a UnixTime
The duration
must be relative to the Unix epoch.
Trait Implementations§
source§impl Ord for UnixTime
impl Ord for UnixTime
source§impl PartialOrd for UnixTime
impl PartialOrd for UnixTime
impl Copy for UnixTime
impl Eq for UnixTime
impl StructuralPartialEq for UnixTime
Auto Trait Implementations§
impl Freeze for UnixTime
impl RefUnwindSafe for UnixTime
impl Send for UnixTime
impl Sync for UnixTime
impl Unpin 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)