pub fn checked_add(self, rhs: MyDuration) -> Option<Time> {
        if let Some(add) = self
            .time
            .checked_add_signed(Duration::nanoseconds(rhs.to_nanos()))
        {
            if add.year() > 9999 {
                return None;
            }
            let mut res = self;
            res.set_time(add);
            Some(res)
        } else {
            None
        }
    }
/// Checked time addition. Computes self + rhs, returning None if overflow occurred.
Checked time addition. Computes self + rhs, returning None if overflow occurred.
Checked time addition . Computes self + rhs returning None if overflow occurred .
pub fn checked_add(self, rhs: MyDuration) -> Option<Time> {
        if let Some(add) = self
            .time
            .checked_add_signed(Duration::nanoseconds(rhs.to_nanos()))
        {
            if add.year() > 9999 {
                return None;
            }
            let mut res = self;
            res.set_time(add);
            Some(res)
        } else {
            None
        }
    }
pub fn checked_add ( self , rhs : MyDuration ) -> Option < Time > { if let Some ( add ) = self . time . checked_add_signed ( Duration :: nanoseconds ( rhs . to_nanos ( ) ) ) { if add . year ( ) > 9999 { return None ; } let mut res = self ; res . set_time ( add ) ; Some ( res ) } else { None } }
Checked time addition.
Checked time addition .
self
rhs
MyDuration
self
rhs
MyDuration