pub struct SystemTime(/* private fields */);
Expand description
A measurement of a system clock.
Implementations§
Source§impl SystemTime
impl SystemTime
Sourcepub const UNIX_EPOCH: Self
pub const UNIX_EPOCH: Self
Represents “1970-01-01 00:00:00 UTC”.
Sourcepub fn from_unix_time_nanos(nanos: u64) -> Self
pub fn from_unix_time_nanos(nanos: u64) -> Self
Creates an instance based on nanoseconds since the unix epoch.
Sourcepub fn to_unix_time_secs(&self) -> u64
pub fn to_unix_time_secs(&self) -> u64
Returns the number of seconds since the unix epoch.
Sourcepub fn to_unix_time_nanos(&self) -> u64
pub fn to_unix_time_nanos(&self) -> u64
Returns the number of nanoseconds since the unix epoch.
Trait Implementations§
Source§impl Clone for SystemTime
impl Clone for SystemTime
Source§fn clone(&self) -> SystemTime
fn clone(&self) -> SystemTime
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for SystemTime
impl Debug for SystemTime
Source§impl From<SystemTime> for SystemTime
impl From<SystemTime> for SystemTime
Source§fn from(sys_time: StdSystemTime) -> Self
fn from(sys_time: StdSystemTime) -> Self
Converts to this type from the input type.
Source§impl From<SystemTime> for SystemTime
impl From<SystemTime> for SystemTime
Source§fn from(sys_time: SystemTime) -> Self
fn from(sys_time: SystemTime) -> Self
Converts to this type from the input type.
Source§impl Ord for SystemTime
impl Ord for SystemTime
Source§fn cmp(&self, other: &SystemTime) -> Ordering
fn cmp(&self, other: &SystemTime) -> Ordering
1.21.0 · 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
Source§impl PartialEq for SystemTime
impl PartialEq for SystemTime
Source§impl PartialOrd for SystemTime
impl PartialOrd for SystemTime
impl Copy for SystemTime
impl Eq for SystemTime
impl StructuralPartialEq for SystemTime
Auto Trait Implementations§
impl Freeze for SystemTime
impl RefUnwindSafe for SystemTime
impl Send for SystemTime
impl Sync for SystemTime
impl Unpin for SystemTime
impl UnwindSafe for SystemTime
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