fn next_batch(&mut self) -> Option<Vec<u8>> {
        if self.next_id == self.origins.len() {
            return None
        }
        let end = cmp::min(self.next_id + 1000, self.origins.len());
        let mut target = Vec::new();
        if self.next_id == 0 {
            self.format.output_header(&self.origins, &mut target).unwrap();
            self.format.output_origin(&self.origins[0], true, &mut target)
                .unwrap();
            self.next_id = 1;
        }
        for addr in &self.origins[self.next_id..end] {
            self.format.output_origin(addr, false, &mut target).unwrap();
        }
        if end == self.origins.len() {
            self.format.output_footer(&self.origins, &mut target).unwrap();
        }
        self.next_id = end;
        Some(target)
    }
/// Creates the next batch of VRPs.
///
/// Returns a buffer with the new batch or `None` if we are done. The
/// first batch will include the header, the last batch will include the
/// footer.
Creates the next batch of VRPs.
Returns a buffer with the new batch or `None` if we are done. The
first batch will include the header, the last batch will include the
footer.
Creates the next batch of VRPs . Returns a buffer with the new batch or ` None ` if we are done . The first batch will include the header the last batch will include the footer .
fn next_batch(&mut self) -> Option<Vec<u8>> {
        if self.next_id == self.origins.len() {
            return None
        }
        let end = cmp::min(self.next_id + 1000, self.origins.len());
        let mut target = Vec::new();
        if self.next_id == 0 {
            self.format.output_header(&self.origins, &mut target).unwrap();
            self.format.output_origin(&self.origins[0], true, &mut target)
                .unwrap();
            self.next_id = 1;
        }
        for addr in &self.origins[self.next_id..end] {
            self.format.output_origin(addr, false, &mut target).unwrap();
        }
        if end == self.origins.len() {
            self.format.output_footer(&self.origins, &mut target).unwrap();
        }
        self.next_id = end;
        Some(target)
    }
fn next_batch ( & mut self ) -> Option < Vec < u8 > > { if self . next_id == self . origins . len ( ) { return None } let end = cmp :: min ( self . next_id + 1000 , self . origins . len ( ) ) ; let mut target = Vec :: new ( ) ; if self . next_id == 0 { self . format . output_header ( & self . origins , & mut target ) . unwrap ( ) ; self . format . output_origin ( & self . origins [ 0 ] , true , & mut target ) . unwrap ( ) ; self . next_id = 1 ; } for addr in & self . origins [ self . next_id .. end ] { self . format . output_origin ( addr , false , & mut target ) . unwrap ( ) ; } if end == self . origins . len ( ) { self . format . output_footer ( & self . origins , & mut target ) . unwrap ( ) ; } self . next_id = end ; Some ( target ) }
Creates the next batch of VRPs.
Creates the next batch of VRPs .
&mut self
&mut self