ZippyLib
ZippyLib is a versatile Rust library designed for integrating file compression and decompression functionalities into Rust projects, supporting a wide array of formats: ZIP, TAR, TAR.GZ, TAR.XZ, TAR.BZ2, BZ2, XZ, GZ, Deflate, and Zlib. This guide provides straightforward API usage instructions to facilitate the inclusion of file compression and decompression capabilities.
Installation
Add ZippyLib to your Rust project by including it in your Cargo.toml
:
[]
= "^0.1"
or use:
Usage
ZIP
use create_zip_archive;
use PathBuf;
let files = vec!;
let output_path = from;
create_zip_archive.expect;
TAR
use create_tar_archive;
use PathBuf;
let files = vec!;
let output_path = from;
create_tar_archive.expect;
TAR.GZ
use create_tar_gz_archive;
use PathBuf;
let files = vec!;
let output_path = from;
create_tar_gz_archive.expect;
TAR.XZ
use create_tar_xz_archive;
use PathBuf;
let files = vec!;
let output_path = from;
create_tar_xz_archive.expect;
TAR.BZ2
use create_tar_bz2_archive;
use PathBuf;
let files = vec!;
let output_path = from;
create_tar_bz2_archive.expect;
BZ2
use create_file_bzip2;
use PathBuf;
let input_path = from;
let output_path = from;
create_file_bzip2.expect;
XZ
use create_file_xz;
use PathBuf;
let input_path = from;
let output_path = from;
create_file_xz.expect;
GZ
use create_gzip_archive;
use PathBuf;
let file_path = from;
let output_path = from;
create_gzip_archive.expect;
Deflate
use encode_file_deflate;
use PathBuf;
let file_to_compress = from;
let output_path = from;
encode_file_deflate.expect;
Zlib
use encode_file_zlib;
use PathBuf;
let file_to_compress = from;
let output_path = from;
encode_file_zlib.expect;
Error Handling
All operations are designed to return a Result<(), ErrorType>
, enabling robust error handling. Specific error types are defined to facilitate detailed error reporting and handling.
Dependencies
ZippyLib makes use of several third-party crates to support its functionality:
- bzip2 (0.4.4)
- flate2 (1.0.28)
- tar (0.4.40)
- tempfile (3.9.0)
- xz2 (0.1.7)
- zip (0.6.6)
These dependencies are critical for providing the comprehensive compression and archiving capabilities of ZippyLib.
License
ZippyLib is licensed under the MIT LICENSE. The full license text is available in the LICENSE
file in the repository.