fn next_page<R: Read>(
    reader: &mut PageReader<R>,
    buffer: &mut Vec<u8>,
) -> Result<Option<CompressedDataPage>> {
    let total_values = reader.total_num_values;
    let mut seen_values = reader.seen_num_values;
    if seen_values >= total_values {
        return Ok(None);
    };

    while seen_values < total_values {
        let page = build_page(reader, buffer)?;
        seen_values = reader.seen_num_values;
        if let Some(page) = page {
            return Ok(Some(page));
        }
    }
    Ok(None)
}
/// This function is lightweight and executes a minimal amount of work so that it is IO bounded.
// Any un-necessary CPU-intensive tasks SHOULD be executed on individual pages.
This function is lightweight and executes a minimal amount of work so that it is IO bounded.
Any un-necessary CPU-intensive tasks SHOULD be executed on individual pages.
This function is lightweight and executes a minimal amount of work so that it is IO bounded . Any un - necessary CPU - intensive tasks SHOULD be executed on individual pages .
fn next_page<R: Read>(
    reader: &mut PageReader<R>,
    buffer: &mut Vec<u8>,
) -> Result<Option<CompressedDataPage>> {
    let total_values = reader.total_num_values;
    let mut seen_values = reader.seen_num_values;
    if seen_values >= total_values {
        return Ok(None);
    };
    while seen_values < total_values {
        let page = build_page(reader, buffer)?;
        seen_values = reader.seen_num_values;
        if let Some(page) = page {
            return Ok(Some(page));
        }
    }
    Ok(None)
}
fn next_page < R : Read > ( reader : & mut PageReader < R > , buffer : & mut Vec < u8 > , ) -> Result < Option < CompressedDataPage > > { let total_values = reader . total_num_values ; let mut seen_values = reader . seen_num_values ; if seen_values >= total_values { return Ok ( None ) ; } ; while seen_values < total_values { let page = build_page ( reader , buffer ) ? ; seen_values = reader . seen_num_values ; if let Some ( page ) = page { return Ok ( Some ( page ) ) ; } } Ok ( None ) }
This function is lightweight and executes a minimal amount of work so that it is IO bounded.
This function is lightweight and executes a minimal amount of work so that it is IO bounded .
reader
&mut PageReader<R>
buffer
&mut Vec<u8>