Lines Matching refs:zip
5 use zip::write::FileOptions;
6 use zip::CompressionMethod;
29 let mut src_archive = zip::ZipArchive::new(src_file).unwrap(); in copy()
30 let mut zip = zip::ZipWriter::new(&mut tgt_file); in copy() localVariable
34 zip.raw_copy_file(file).unwrap(); in copy()
39 zip.raw_copy_file_rename(file, COPY_ENTRY_NAME).unwrap(); in copy()
43 let mut tgt_archive = zip::ZipArchive::new(tgt_file).unwrap(); in copy()
49 fn write_to_zip(file: &mut Cursor<Vec<u8>>) -> zip::result::ZipResult<()> { in write_to_zip()
50 let mut zip = zip::ZipWriter::new(file); in write_to_zip() localVariable
52 zip.add_directory("test/", Default::default())?; in write_to_zip()
57 zip.start_file("test/☃.txt", options)?; in write_to_zip()
58 zip.write_all(b"Hello, World!\n")?; in write_to_zip()
60 zip.start_file(ENTRY_NAME, Default::default())?; in write_to_zip()
61 zip.write_all(LOREM_IPSUM)?; in write_to_zip()
63 zip.finish()?; in write_to_zip()
67 fn read_zip<R: Read + Seek>(zip_file: R) -> zip::result::ZipResult<zip::ZipArchive<R>> { in read_zip()
68 let archive = zip::ZipArchive::new(zip_file).unwrap(); in read_zip()
79 archive: &mut zip::ZipArchive<R>, in read_zip_file()
81 ) -> zip::result::ZipResult<String> { in read_zip_file()
94 fn check_zip_file_contents<R: Read + Seek>(archive: &mut zip::ZipArchive<R>, name: &str) { in check_zip_file_contents()