1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//! Streaming async ZIP archive writer with per-file deflate compression.
//!
//! This crate provides an asynchronous interface for creating ZIP archives
//! from streams of data. Unlike blocking ZIP writers, entries are written
//! incrementally — each file is compressed and written to the output as it
//! arrives, without buffering the entire archive in memory.
//!
//! # Public API
//!
//! The main entry point is [`ZipWriter`], which accepts per-entry metadata
//! via [`EntryOptions`]. Individual file data is streamed through
//! [`EntryWriter`], obtained from [`ZipWriter::append_file`].
//!
//! # Quick Start
//!
//! ```rust,no_run
//! use async_deflate_zip::{ZipWriter, EntryOptions};
//! use tokio::io::AsyncWriteExt;
//!
//! # async fn example() {
//! let mut buf = Vec::new();
//! let mut zip = ZipWriter::new(&mut buf);
//!
//! let mut entry = zip.append_file("hello.txt", EntryOptions::file()).await.unwrap();
//! entry.write_all(b"Hello, World!").await.unwrap();
//! entry.close().await.unwrap();
//!
//! zip.finalize().await.unwrap();
//! # }
//! ```
pub use ZipError;
pub use Compression;
pub use EntryOptions;
pub use EntryWriter;
pub use ZipWriter;