fn check_deserialize_file_consumed<P>(
    file_size: u64,
    file_path: P,
    file_stream: &mut BufReader<File>,
) -> Result<()>
where
    P: AsRef<Path>,
{
    let consumed_size = file_stream.stream_position()?;

    if consumed_size != file_size {
        let error_message =
            format!(
            "invalid snapshot data file: {} has {} bytes, however consumed {} bytes to deserialize",
            file_path.as_ref().display(), file_size, consumed_size
        );
        return Err(get_io_error(&error_message));
    }

    Ok(())
}
/// After running the deserializer function, perform common checks to ensure the snapshot archive
/// files were consumed correctly.
After running the deserializer function, perform common checks to ensure the snapshot archive
files were consumed correctly.
After running the deserializer function perform common checks to ensure the snapshot archive files were consumed correctly .
fn check_deserialize_file_consumed<P>(
    file_size: u64,
    file_path: P,
    file_stream: &mut BufReader<File>,
) -> Result<()>
where
    P: AsRef<Path>,
{
    let consumed_size = file_stream.stream_position()?;
    if consumed_size != file_size {
        let error_message =
            format!(
            "invalid snapshot data file: {} has {} bytes, however consumed {} bytes to deserialize",
            file_path.as_ref().display(), file_size, consumed_size
        );
        return Err(get_io_error(&error_message));
    }
    Ok(())
}
fn check_deserialize_file_consumed < P > ( file_size : u64 , file_path : P , file_stream : & mut BufReader < File > , ) -> Result < ( ) > where P : AsRef < Path > , { let consumed_size = file_stream . stream_position ( ) ? ; if consumed_size != file_size { let error_message = format ! ( " " file_path as_ref ( ) display ( ) file_size consumed_size ) ; return Err ( get_io_error ( & error_message ) ) ; } Ok ( ( ) ) }
After running the deserializer function, perform common checks to ensure the snapshot archive
files were consumed correctly.
After running the deserializer function perform common checks to ensure the snapshot archive files were consumed correctly .
file_size
u64
file_path
P
file_stream
&mut BufReader<File>