Module zip
Read and write ZIP archives.
zip provides support for reading and writing ZIP archives,
including compressed entries using DEFLATE and other algorithms.
Useful for bundling files, creating backups, or working with
formats that are ZIP-based (like EPUB, DOCX, JAR).
The main types are ZipArchive for reading existing archives
and ZipWriter for creating new ones.
Use ZipArchive::new to open a ZIP file for reading.
Examples
Read files from a ZIP archive:
use File;
use Read;
use ZipArchive;
let file = open.unwrap;
let mut archive = new.unwrap;
for i in 0..archive.len
Create a new ZIP archive:
use File;
use Write;
use SimpleFileOptions;
use ZipWriter;
let file = create.unwrap;
let mut zip = new;
let options = default
.compression_method;
zip.start_file.unwrap;
zip.write_all.unwrap;
zip.finish.unwrap;
Modules
- extra_fields types for extra fields
- read Types for reading ZIP archives
- result Error types that can be emitted from this library
-
unstable
Unstable APIs All APIs accessible by importing this module are unstable; They may be changed in patch releases. You MUST use an exact version specifier in
Cargo.toml, to indicate the version of this API you're using: - write Types for creating ZIP archives