| 1 |
//! A library for reading and writing ZIP archives. |
| 2 |
//! ZIP is a format designed for cross-platform file "archiving". |
| 3 |
//! That is, storing a collection of files in a single datastream |
| 4 |
//! to make them easier to share between computers. |
| 5 |
//! Additionally, ZIP is able to compress and encrypt files in its |
| 6 |
//! archives. |
| 7 |
//! |
| 8 |
//! The current implementation is based on [PKWARE's APPNOTE.TXT v6.3.9](https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT) |
| 9 |
//! |
| 10 |
//! --- |
| 11 |
//! |
| 12 |
//! [`zip`](`crate`) has support for the most common ZIP archives found in common use. |
| 13 |
//! However, in special cases, |
| 14 |
//! there are some zip archives that are difficult to read or write. |
| 15 |
//! |
| 16 |
//! This is a list of supported features: |
| 17 |
//! |
| 18 |
//! | | Reading | Writing | |
| 19 |
//! | ------- | ------ | ------- | |
| 20 |
//! | Deflate | ✅ [->](`crate::ZipArchive::by_name`) | ✅ [->](`crate::write::FileOptions::compression_method`) | |
| 21 |
//! | Deflate64 | ✅ | | |
| 22 |
//! | Bzip2 | ✅ | ✅ | |
| 23 |
//! | LZMA | ✅ | | |
| 24 |
//! | AES encryption | ✅ | ✅ | |
| 25 |
//! | ZipCrypto deprecated encryption | ✅ | ✅ | |
| 26 |
//! |
| 27 |
//! |
| 28 |
#![cfg_attr(docsrs, feature(doc_auto_cfg))] |
| 29 |
#![warn(missing_docs)] |
| 30 |
#![allow(unexpected_cfgs)] // Needed for cfg(fuzzing) on nightly as of 2024-05-06 |
| 31 |
pub use crate::compression::{CompressionMethod, SUPPORTED_COMPRESSION_METHODS}; |
| 32 |
pub use crate::read::ZipArchive; |
| 33 |
pub use crate::types::{AesMode, DateTime}; |
| 34 |
pub use crate::write::ZipWriter; |
| 35 |
|
| 36 |
#[cfg(feature = "aes-crypto")] |
| 37 |
mod aes; |
| 38 |
#[cfg(feature = "aes-crypto")] |
| 39 |
mod aes_ctr; |
| 40 |
mod compression; |
| 41 |
mod cp437; |
| 42 |
mod crc32; |
| 43 |
pub mod extra_fields; |
| 44 |
pub mod read; |
| 45 |
pub mod result; |
| 46 |
mod spec; |
| 47 |
mod types; |
| 48 |
pub mod write; |
| 49 |
mod zipcrypto; |
| 50 |
pub use extra_fields::ExtraField; |
| 51 |
|
| 52 |
#[doc = "Unstable APIs\n\ |
| 53 |
\ |
| 54 |
All APIs accessible by importing this module are unstable; They may be changed in patch \ |
| 55 |
releases. You MUST use an exact version specifier in `Cargo.toml`, to indicate the version of this \ |
| 56 |
API you're using:\n\ |
| 57 |
\ |
| 58 |
```toml\n |
| 59 |
[dependencies]\n |
| 60 |
zip = \"="] |
| 61 |
#[doc=env!("CARGO_PKG_VERSION")] |
| 62 |
#[doc = "\"\n\ |
| 63 |
```"] |
| 64 |
pub mod unstable; |