Trait SystemTimeExt
trait SystemTimeExt: sealed::Sealed
An extension trait for std::time::SystemTime that adds methods for
time::Durations.
Required Methods
fn checked_add_signed(self: &Self, duration: Duration) -> Option<Self>Adds the given
Durationto theSystemTime, returningNoneis the result cannot be represented by the underlying data structure.fn checked_sub_signed(self: &Self, duration: Duration) -> Option<Self>Subtracts the given
Durationfrom theSystemTime, returningNoneis the result cannot be represented by the underlying data structure.fn signed_duration_since(self: &Self, earlier: Self) -> DurationReturns the amount of time elapsed from another
SystemTimeto this one. This will be negative ifearlieris later thanself.If the duration cannot be stored by
Duration, the value will be saturated toDuration::MINorDuration::MAXas appropriate.Example
# use SystemTime; # use ; let epoch = UNIX_EPOCH; let other = epoch + 1.seconds; assert_eq!; assert_eq!;
Implementors
impl SystemTimeExt for SystemTime