pub fn checked_sub(self, rhs: MyDuration) -> Option<Time> {
        if let Some(sub) = self
            .time
            .checked_sub_signed(Duration::nanoseconds(rhs.to_nanos()))
        {
            if sub.year() < 0 {
                return None;
            }
            let mut res = self;
            res.set_time(sub);
            Some(res)
        } else {
            None
        }
    }
/// Checked time subtraction. Computes self - rhs, returning None if overflow occurred.
Checked time subtraction. Computes self - rhs, returning None if overflow occurred.
Checked time subtraction . Computes self - rhs returning None if overflow occurred .
pub fn checked_sub(self, rhs: MyDuration) -> Option<Time> {
        if let Some(sub) = self
            .time
            .checked_sub_signed(Duration::nanoseconds(rhs.to_nanos()))
        {
            if sub.year() < 0 {
                return None;
            }
            let mut res = self;
            res.set_time(sub);
            Some(res)
        } else {
            None
        }
    }
pub fn checked_sub ( self , rhs : MyDuration ) -> Option < Time > { if let Some ( sub ) = self . time . checked_sub_signed ( Duration :: nanoseconds ( rhs . to_nanos ( ) ) ) { if sub . year ( ) < 0 { return None ; } let mut res = self ; res . set_time ( sub ) ; Some ( res ) } else { None } }
Checked time subtraction.
Checked time subtraction .
self
rhs
MyDuration
self
rhs
MyDuration