Trait time_utils::CheckedSystemTime
source · [−]pub trait CheckedSystemTime {
fn checked_add(self, _d: Duration) -> Option<SystemTime>;
fn checked_sub(self, _d: Duration) -> Option<SystemTime>;
}
Expand description
Temporary trait for checked operations
on SystemTime until these are available in the standard library
Required methods
fn checked_add(self, _d: Duration) -> Option<SystemTime>
fn checked_add(self, _d: Duration) -> Option<SystemTime>
Returns Some<SystemTime>
when the result less or equal to i32::max_value
to prevent SystemTime
to panic because
it is platform specific, possible representations are i32, i64, u64 or Duration. None
otherwise
fn checked_sub(self, _d: Duration) -> Option<SystemTime>
fn checked_sub(self, _d: Duration) -> Option<SystemTime>
Returns Some<SystemTime>
when the result is successful and None
when it is not