An asynchronous ZIP archive reading/writing crate powered by tokio
.
toml
[dependencies]
async_zip = "0.0.9"
A (soon to be) extensive list of examples can be found under the /examples
directory.
```rust use tokio::{io::AsyncReadExt, fs::File}; use async_zip::read::seek::ZipFileReader; ...
let mut file = File::open("./Archive.zip").await.unwrap(); let mut zip = ZipFileReader::new(&mut file).await.unwrap();
let mut reader = zip.entryreader(0).await.unwrap(); let txt = reader.readtostringcrc().await.unwrap();
println!("{}", txt); ```
```rust use asynczip::write::ZipFileWriter; use asynczip::{Compression, ZipEntryBuilder}; use tokio::fs::File; ...
let mut file = File::create("foo.zip").await.unwrap(); let mut writer = ZipFileWriter::new(&mut file);
let data = b"This is an example file."; let builder = ZipEntryBuilder::new(String::from("bar.txt"), Compression::Deflate);
writer.writeentrywhole(builder, data).await.unwrap(); writer.close().await.unwrap(); ```
Whilst I will be continuing to maintain this crate myself, reasonable specification compliance is a huge undertaking for a single individual. As such, contributions will always be encouraged and appreciated.
No contribution guidelines exist but additions should be developed with readability in mind, with appropriate comments, and make use of rustfmt
.
Whether you're wanting to report a bug you've come across during use of this crate or are seeking general help/assistance, please utilise the issues tracker and provide as much detail as possible (eg. recreation steps).
I try to respond to issues within a reasonable timeframe.