pub fn zip_stream(files: impl IntoIterator<Item = ZipEntry>, options: ZipOptions) -> impl StreamRange {
    let mut data_parts: Vec<Box<dyn StreamRange>> = Vec::new();
    let mut central_directory_parts: Vec<Box<dyn StreamRange>> = Vec::new();
    let mut offset = 0;

    for file in files {
        let local_header = local_file_header(&file, options.force_zip64);
        let central_header = central_directory_file_header(&file, offset, options.force_zip64);

        offset += local_header.len() as u64 + file.data.len() as u64;

        data_parts.push(Box::new(local_header));
        data_parts.push(file.data);

        central_directory_parts.push(Box::new(central_header));
    }

    let num_entries = central_directory_parts.len() as u64;
    let size_of_central_directory = central_directory_parts.iter().map(|x| x.len() as u64).sum();

    data_parts.extend(central_directory_parts.into_iter());
    data_parts.push(Box::new(end_of_central_directory(offset, size_of_central_directory, num_entries, options.force_zip64)));

    stream_range::Concatenated(data_parts)
}
/// Create a `StreamRange` that produces a ZIP file with the passed entries.
Create a `StreamRange` that produces a ZIP file with the passed entries.
Create a ` StreamRange ` that produces a ZIP file with the passed entries .
pub fn zip_stream(files: impl IntoIterator<Item = ZipEntry>, options: ZipOptions) -> impl StreamRange {
    let mut data_parts: Vec<Box<dyn StreamRange>> = Vec::new();
    let mut central_directory_parts: Vec<Box<dyn StreamRange>> = Vec::new();
    let mut offset = 0;
    for file in files {
        let local_header = local_file_header(&file, options.force_zip64);
        let central_header = central_directory_file_header(&file, offset, options.force_zip64);
        offset += local_header.len() as u64 + file.data.len() as u64;
        data_parts.push(Box::new(local_header));
        data_parts.push(file.data);
        central_directory_parts.push(Box::new(central_header));
    }
    let num_entries = central_directory_parts.len() as u64;
    let size_of_central_directory = central_directory_parts.iter().map(|x| x.len() as u64).sum();
    data_parts.extend(central_directory_parts.into_iter());
    data_parts.push(Box::new(end_of_central_directory(offset, size_of_central_directory, num_entries, options.force_zip64)));
    stream_range::Concatenated(data_parts)
}
pub fn zip_stream ( files : impl IntoIterator < Item = ZipEntry > , options : ZipOptions ) -> impl StreamRange { let mut data_parts : Vec < Box < dyn StreamRange > > = Vec :: new ( ) ; let mut central_directory_parts : Vec < Box < dyn StreamRange > > = Vec :: new ( ) ; let mut offset = 0 ; for file in files { let local_header = local_file_header ( & file , options . force_zip64 ) ; let central_header = central_directory_file_header ( & file , offset , options . force_zip64 ) ; offset += local_header . len ( ) as u64 + file . data . len ( ) as u64 ; data_parts . push ( Box :: new ( local_header ) ) ; data_parts . push ( file . data ) ; central_directory_parts . push ( Box :: new ( central_header ) ) ; } let num_entries = central_directory_parts . len ( ) as u64 ; let size_of_central_directory = central_directory_parts . iter ( ) . map ( | x | x . len ( ) as u64 ) . sum ( ) ; data_parts . extend ( central_directory_parts . into_iter ( ) ) ; data_parts . push ( Box :: new ( end_of_central_directory ( offset , size_of_central_directory , num_entries , options . force_zip64 ) ) ) ; stream_range :: Concatenated ( data_parts ) }
Create a `StreamRange` that produces a ZIP file with the passed entries.
Create a ` StreamRange ` that produces a ZIP file with the passed entries .
files
impl IntoIterator<Item = ZipEntry>
options
ZipOptions
files
impl IntoIterator<Item = ZipEntry>
options
ZipOptions