Crate zip
A library for reading and writing ZIP archives. ZIP is a format designed for cross-platform file "archiving". That is, storing a collection of files in a single datastream to make them easier to share between computers. Additionally, ZIP is able to compress and encrypt files in its archives.
The current implementation is based on PKWARE's APPNOTE.TXT v6.3.9
zip has support for the most common ZIP archives found in common use.
However, in special cases,
there are some zip archives that are difficult to read or write.
This is a list of supported features:
| Reading | Writing | |
|---|---|---|
| Stored | ✅ | ✅ |
| Deflate | ✅ -> | ✅ -> |
| Deflate64 | ✅ | |
| Bzip2 | ✅ | ✅ |
| ZStandard | ✅ | ✅ |
| LZMA | ✅ | |
| XZ | ✅ | ✅ |
| PPMd | ✅ | ✅ |
| AES encryption | ✅ | ✅ |
| ZipCrypto deprecated encryption | ✅ | ✅ |
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
Structs
- DateTime Representation of a moment in time.
- ZipArchive ZIP archive reader
- ZipReadOptions Options for reading a file from an archive.
- ZipWriter ZIP archive generator
Enums
- AesMode AES variant used.
- CompressionMethod Identifies the storage format used to compress a file within a ZIP archive.
- ExtraField contains one extra field
Traits
- HasZipMetadata A trait for exposing file metadata inside the zip.
Constants
- SUPPORTED_COMPRESSION_METHODS The compression methods which have been implemented.
- ZIP64_BYTES_THR The file size at which a ZIP64 record becomes necessary.
- ZIP64_ENTRY_THR The number of entries within a single zip necessary to allocate a zip64 central directory record.