Expand description
Async ZIP archive implementation.
This module provides AsyncZipArchive, an async implementation of the AsyncArchiveReader
trait using the async-zip crate for non-blocking ZIP file access.
§Implementation Details
- Uses
async-zipwith tokio compatibility layer (tokio-util::compat) - Wraps readers in
BufReaderfor efficient I/O - Converts between tokio’s
AsyncReadand futures’AsyncReadtraits
§Examples
use lib3mf_async::zip::AsyncZipArchive;
use lib3mf_async::archive::AsyncArchiveReader;
use tokio::fs::File;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Open a 3MF file (ZIP archive)
let file = File::open("model.3mf").await?;
let mut archive = AsyncZipArchive::new(file).await?;
// Read an entry
let model_rels = archive.read_entry("_rels/.rels").await?;
println!("Relationships XML: {} bytes", model_rels.len());
Ok(())
}Structs§
- Async
ZipArchive - Async ZIP archive reader implementing
AsyncArchiveReader.