Trait CheckedSystemTime

Source
pub trait CheckedSystemTime {
    // Required methods
    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§

Source

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

Source

fn checked_sub(self, _d: Duration) -> Option<SystemTime>

Returns Some<SystemTime> when the result is successful and None when it is not

Implementations on Foreign Types§

Source§

impl CheckedSystemTime for SystemTime

Implementors§