fn advance_iteartor(&mut self) -> Result<Option<()>, failure::Error> {
        if self.current_segment >= self.segment_files.len() - 1 {
            return Ok(None);
        }
        self.current_segment = self.current_segment + 1;
        let partition_path = Path::new(&self.cfg.dir)
            .join("partition")
            .join(&self.partition);
        let segment_file = self.segment_files.get(self.current_segment).unwrap();
        let iterator = SegmentIterator::new(
            segment_file.id,
            partition_path,
            self.store.clone(),
            self.selection.clone(),
            self.partition.clone(),
            self.distance,
            self.start_ts,
            self.end_ts,
            self.backward,
        )?;
        if iterator.entry().is_none() {
            // this iterator doesn't have the query so recursively advance.
            return self.advance_iteartor();
        }
        self.current_iterator = Some(iterator);
        Ok(Some(()))
    }
/// advance_iterator is used to advance next segment iterator.
advance_iterator is used to advance next segment iterator.
advance_iterator is used to advance next segment iterator .
fn advance_iteartor(&mut self) -> Result<Option<()>, failure::Error> {
        if self.current_segment >= self.segment_files.len() - 1 {
            return Ok(None);
        }
        self.current_segment = self.current_segment + 1;
        let partition_path = Path::new(&self.cfg.dir)
            .join("partition")
            .join(&self.partition);
        let segment_file = self.segment_files.get(self.current_segment).unwrap();
        let iterator = SegmentIterator::new(
            segment_file.id,
            partition_path,
            self.store.clone(),
            self.selection.clone(),
            self.partition.clone(),
            self.distance,
            self.start_ts,
            self.end_ts,
            self.backward,
        )?;
        if iterator.entry().is_none() {
            // this iterator doesn't have the query so recursively advance.
            return self.advance_iteartor();
        }
        self.current_iterator = Some(iterator);
        Ok(Some(()))
    }
fn advance_iteartor ( & mut self ) -> Result < Option < ( ) > , failure :: Error > { if self . current_segment >= self . segment_files . len ( ) - 1 { return Ok ( None ) ; } self . current_segment = self . current_segment + 1 ; let partition_path = Path :: new ( & self . cfg . dir ) . join ( " " ) . join ( & self . partition ) ; let segment_file = self . segment_files . get ( self . current_segment ) . unwrap ( ) ; let iterator = SegmentIterator :: new ( segment_file . id , partition_path , self . store . clone ( ) , self . selection . clone ( ) , self . partition . clone ( ) , self . distance , self . start_ts , self . end_ts , self . backward , ) ? ; if iterator . entry ( ) . is_none ( ) { // this iterator doesn't have the query so recursively advance. return self . advance_iteartor ( ) ; } self . current_iterator = Some ( iterator ) ; Ok ( Some ( ( ) ) ) }
advance_iterator is used to advance next segment iterator.
advance_iterator is used to advance next segment iterator .
&mut self