Skip to main content

hexz_core/api/
mod.rs

1//! Public API for archive file access.
2//!
3//! This module provides the high-level API for reading Hexz archives.
4//! It re-exports the main types used by applications and libraries to interact
5//! with `.hxz` files.
6//!
7//! # Main Types
8//!
9//! - `Archive`: Main handle for reading archives
10//! - `ArchiveStream`: Logical stream identifier (Main or Auxiliary)
11//! - `ArchiveManifest`: Directory tree manifest for file-based archives
12//!
13//! # Usage Example
14//!
15//! ```ignore
16//! use hexz_core::api::file::{Archive, ArchiveStream};
17//! use hexz_store::local::FileBackend;
18//! use hexz_core::algo::compression::lz4::Lz4Compressor;
19//! use std::sync::Arc;
20//!
21//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
22//! // Open an archive
23//! let backend = Arc::new(FileBackend::new("data.hxz".as_ref())?);
24//! let compressor = Box::new(Lz4Compressor::new());
25//! let archive = Archive::new(backend, compressor, None)?;
26//!
27//! // Read from main stream
28//! let data = archive.read_at(ArchiveStream::Main, 0, 512)?;
29//! println!("First sector: {:?}", &data[..64]);
30//! # Ok(())
31//! # }
32//! ```
33
34/// High-level archive file API.
35pub mod file;
36
37/// Archive manifest for directory-based archives.
38pub mod manifest;