fn inverse(&self) -> UnnamedTimeSegment {
        let mut ranges: Vec<Range<DateTime<Utc>>> = vec![];
        if self.ranges().len() > 0 {
            if self.ranges()[0].start - self.start() > Duration::seconds(0) {
                ranges.push(self.start()..self.ranges()[0].start);
            }
            for i in 0..self.ranges().len() - 1 {
                if self.ranges()[i + 1].start - self.ranges()[i].end > Duration::seconds(0) {
                    ranges.push(self.ranges()[i].end..self.ranges()[i + 1].start);
                }
            }
            if self.start() + self.period() - self.ranges()[self.ranges().len() - 1].end
                > Duration::seconds(0)
            {
                ranges
                    .push(self.ranges()[self.ranges().len() - 1].end..self.start() + self.period());
            }
        } else {
            ranges.push(self.start()..self.start() + self.period());
        }
        UnnamedTimeSegment {
            ranges,
            start: self.start(),
            period: self.period(),
        }
    }
/// Construct the inverse of the time segment, i.e. the time segment made up
/// of all time that the given time segment _doesn't_ cover.
Construct the inverse of the time segment, i.e. the time segment made up
of all time that the given time segment _doesn't_ cover.
Construct the inverse of the time segment i . e . the time segment made up of all time that the given time segment _doesn ' t_ cover .
fn inverse(&self) -> UnnamedTimeSegment {
        let mut ranges: Vec<Range<DateTime<Utc>>> = vec![];
        if self.ranges().len() > 0 {
            if self.ranges()[0].start - self.start() > Duration::seconds(0) {
                ranges.push(self.start()..self.ranges()[0].start);
            }
            for i in 0..self.ranges().len() - 1 {
                if self.ranges()[i + 1].start - self.ranges()[i].end > Duration::seconds(0) {
                    ranges.push(self.ranges()[i].end..self.ranges()[i + 1].start);
                }
            }
            if self.start() + self.period() - self.ranges()[self.ranges().len() - 1].end
                > Duration::seconds(0)
            {
                ranges
                    .push(self.ranges()[self.ranges().len() - 1].end..self.start() + self.period());
            }
        } else {
            ranges.push(self.start()..self.start() + self.period());
        }
        UnnamedTimeSegment {
            ranges,
            start: self.start(),
            period: self.period(),
        }
    }
fn inverse ( & self ) -> UnnamedTimeSegment { let mut ranges : Vec < Range < DateTime < Utc > > > = vec ! [ ] ; if self . ranges ( ) . len ( ) > 0 { if self . ranges ( ) [ 0 ] . start - self . start ( ) > Duration :: seconds ( 0 ) { ranges . push ( self . start ( ) .. self . ranges ( ) [ 0 ] . start ) ; } for i in 0 .. self . ranges ( ) . len ( ) - 1 { if self . ranges ( ) [ i + 1 ] . start - self . ranges ( ) [ i ] . end > Duration :: seconds ( 0 ) { ranges . push ( self . ranges ( ) [ i ] . end .. self . ranges ( ) [ i + 1 ] . start ) ; } } if self . start ( ) + self . period ( ) - self . ranges ( ) [ self . ranges ( ) . len ( ) - 1 ] . end > Duration :: seconds ( 0 ) { ranges . push ( self . ranges ( ) [ self . ranges ( ) . len ( ) - 1 ] . end .. self . start ( ) + self . period ( ) ) ; } } else { ranges . push ( self . start ( ) .. self . start ( ) + self . period ( ) ) ; } UnnamedTimeSegment { ranges , start : self . start ( ) , period : self . period ( ) , } }
Construct the inverse of the time segment, i.e.
Construct the inverse of the time segment i . e .
&self
&self