Crate archive_reader
source ·Expand description
ArchiveReader is a library that wraps partial read functions from libarchive.
It provides rustic interface over listing file names and reading given files within archives.
Example
use archive_reader::Archive;
use archive_reader::error::Result;
fn main() -> Result<()> {
    let mut archive = Archive::open("some_archive.zip");
    let file_names = archive
                        .block_size(1024 * 1024)
                        .list_file_names()?
                        .collect::<Result<Vec<_>>>()?;
    let mut content = vec![];
    let _ = archive.read_file(&file_names[0], &mut content)?;
    println!("content={content:?}");
    Ok(())
}Features
- lending_iter- Enables- LendingIteratorimplementation, which avoids heap allocations for- read_file_by_blockfunction.
Re-exports
- pub use error::*;
Modules
Structs
- Archiverepresents an archive file which can be processed.
- Entryrepresents a file / dir in an archive.