unzpack

Crates.iounzpack
lib.rsunzpack
version0.1.0
sourcesrc
created_at2020-05-17 23:20:11.60165
updated_at2020-05-17 23:20:11.60165
descriptionA library to persist ZIP content bytes into a file and extract its content on file system.
homepage
repositoryhttps://github.com/joseluisq/unzpack
max_upload_size
id242826
size22,705
Jose Quintana (joseluisq)

documentation

https://docs.rs/unzpack

README

Unzpack Build Status Crates.io version Released API docs

A library to persist ZIP content bytes into a file and extract its content on file system.

Unzpack is just a helper which persists ZIP bytes content on file system, then extract its content into a specific directory path and finally deletes current ZIP file.

For example, it can be useful when ZIP content is provided via include_bytes! macro.

Usage

[dependencies]
unzpack = "0.1"
use unzpack::Unzpack;

const BYTES: &[u8] = include_bytes!("data/assets.zip");

fn main() -> Result<(), Box<dyn std::error::Error>> {
    Unzpack::unpack(
        BYTES,              // Zip bytes
        "./out-file.zip",   // Output Zip file 
        "./out-dir",        // Output extraction directory 
    )?;

    Ok(())
}

View code example.

Contributions

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in current work by you, as defined in the Apache-2.0 license, shall be dual licensed as described below, without any additional terms or conditions.

Feel free to send some Pull request or issue.

License

This work is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0).

© 2020 Jose Quintana

Commit count: 12

cargo fmt