pub fn advance<'a>(&'a mut self, include_truncated: bool) {
        loop {
            // The last file we read indicated EOF, so we need
            // to advance sections or bail out if unable to.
            if self.known_eof {
                match self.component.next() {
                    Some(c) => {
                        self.component = c;
                        self.known_eof = false;
                        self.section = None;
                        self.section_offset = 0;
                    }

                    None => {
                        return;
                    }
                }
            }

            // We haven't opened the next section yet, so attempt to.
            // If it doesn't exist, we do nothing. If it does, attempt to
            // open the file. If that fails, which should be rare, store
            // the error.
            if self.section.is_none() {
                let (_, section_path) = self.component.paths(&self.path_buf);

                if section_path.exists() {
                    let reader = SectionReader::new(
                        section_path,
                        self.max_file_size,
                        self.max_item_size,
                        self.read_chunk_size,
                        Some(self.section_offset),
                    );

                    match reader {
                        Ok(iterator) => {
                            self.section = Some(iterator);
                        }

                        Err(e) => {
                            self.error = Some(e);
                            return;
                        }
                    }
                }
            }

            match self.section {
                Some(ref mut s) => {
                    s.advance();

                    match s.current() {
                        Ok(Some(ref item)) => {
                            self.known_eof = item.known_eof;
                            self.section_offset = item.id;

                            if !item.truncated || include_truncated {
                                return;
                            }

                            // this is the only branch that continues
                        }

                        Ok(None) => {
                            return;
                        }

                        Err(e) => {
                            self.error = Some(e);
                            return;
                        }
                    }
                }

                None => {
                    return;
                }
            }
        }
    }
/// Advances to the next item. If the next item is truncated and
/// include_truncated is false, it is skipped.
Advances to the next item. If the next item is truncated and
include_truncated is false, it is skipped.
Advances to the next item . If the next item is truncated and include_truncated is false it is skipped .
pub fn advance<'a>(&'a mut self, include_truncated: bool) {
        loop {
            // The last file we read indicated EOF, so we need
            // to advance sections or bail out if unable to.
            if self.known_eof {
                match self.component.next() {
                    Some(c) => {
                        self.component = c;
                        self.known_eof = false;
                        self.section = None;
                        self.section_offset = 0;
                    }
                    None => {
                        return;
                    }
                }
            }
            // We haven't opened the next section yet, so attempt to.
            // If it doesn't exist, we do nothing. If it does, attempt to
            // open the file. If that fails, which should be rare, store
            // the error.
            if self.section.is_none() {
                let (_, section_path) = self.component.paths(&self.path_buf);
                if section_path.exists() {
                    let reader = SectionReader::new(
                        section_path,
                        self.max_file_size,
                        self.max_item_size,
                        self.read_chunk_size,
                        Some(self.section_offset),
                    );
                    match reader {
                        Ok(iterator) => {
                            self.section = Some(iterator);
                        }
                        Err(e) => {
                            self.error = Some(e);
                            return;
                        }
                    }
                }
            }
            match self.section {
                Some(ref mut s) => {
                    s.advance();
                    match s.current() {
                        Ok(Some(ref item)) => {
                            self.known_eof = item.known_eof;
                            self.section_offset = item.id;
                            if !item.truncated || include_truncated {
                                return;
                            }
                            // this is the only branch that continues
                        }
                        Ok(None) => {
                            return;
                        }
                        Err(e) => {
                            self.error = Some(e);
                            return;
                        }
                    }
                }
                None => {
                    return;
                }
            }
        }
    }
pub fn advance < ' a > ( & ' a mut self , include_truncated : bool ) { loop { // The last file we read indicated EOF, so we need // to advance sections or bail out if unable to. if self . known_eof { match self . component . next ( ) { Some ( c ) => { self . component = c ; self . known_eof = false ; self . section = None ; self . section_offset = 0 ; } None => { return ; } } } // We haven't opened the next section yet, so attempt to. // If it doesn't exist, we do nothing. If it does, attempt to // open the file. If that fails, which should be rare, store // the error. if self . section . is_none ( ) { let ( _ , section_path ) = self . component . paths ( & self . path_buf ) ; if section_path . exists ( ) { let reader = SectionReader :: new ( section_path , self . max_file_size , self . max_item_size , self . read_chunk_size , Some ( self . section_offset ) , ) ; match reader { Ok ( iterator ) => { self . section = Some ( iterator ) ; } Err ( e ) => { self . error = Some ( e ) ; return ; } } } } match self . section { Some ( ref mut s ) => { s . advance ( ) ; match s . current ( ) { Ok ( Some ( ref item ) ) => { self . known_eof = item . known_eof ; self . section_offset = item . id ; if ! item . truncated || include_truncated { return ; } // this is the only branch that continues } Ok ( None ) => { return ; } Err ( e ) => { self . error = Some ( e ) ; return ; } } } None => { return ; } } } }
Advances to the next item.
Advances to the next item .
&'a mut self
include_truncated
bool
&'a mut self
include_truncated
bool