Struct cap_std::time::SystemTime [−][src]
pub struct SystemTime { /* fields omitted */ }Expand description
A measurement of the system clock, useful for talking to external entities like the file system or other processes.
This corresponds to std::time::SystemTime.
Note that this SystemTime has no now, elapsed methods. To obtain the
current time or measure the duration to the current time, you must first
obtain a SystemClock, and then call SystemClock::now or
SystemClock::elapsed instead. The UNIX_EPOCH constant is at
SystemClock::UNIX_EPOCH.
Similar to the filetime crate, when
RUSTFLAGS=--cfg emulate_second_only_system is set, SystemTime will
round times from the operating system down to the second. This emulates
the behavior of some file systems, mostly
HFS, allowing debugging on other hardware.
Implementations
Constructs a new instance of Self from the given
std::time::SystemTime.
Constructs a new instance of std::time::SystemTime from the given
Self.
Returns the amount of time elapsed from another instant to this one.
This corresponds to std::time::SystemTime::duration_since.
Returns Some(t) where t is the time self + duration if t can be
represented as SystemTime (which means it’s inside the bounds of the
underlying data structure), None otherwise.
This corresponds to std::time::SystemTime::checked_add.
Returns Some(t) where t is the time self - duration if t can be
represented as SystemTime (which means it’s inside the bounds of the
underlying data structure), None otherwise.
This corresponds to std::time::SystemTime::checked_sub.
Trait Implementations
Panics
This function may panic if the resulting point in time cannot be
represented by the underlying data structure. See
SystemTime::checked_add for a version without panic.
type Output = SystemTime
type Output = SystemTime
The resulting type after applying the + operator.
Performs the += operation. Read more
This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
type Output = SystemTime
type Output = SystemTime
The resulting type after applying the - operator.
Performs the - operation. Read more
Performs the -= operation. Read more
Auto Trait Implementations
impl RefUnwindSafe for SystemTime
impl Send for SystemTime
impl Sync for SystemTime
impl Unpin for SystemTime
impl UnwindSafe for SystemTime
Blanket Implementations
Mutably borrows from an owned value. Read more