hd_cas/lib.rs
1//! # hd-cas
2//!
3//! Content-addressable store for hyperdocker.
4//!
5//! This crate provides a BLAKE3-hashed, content-defined chunked storage system.
6//! Files are split into variable-size chunks using FastCDC, hashed with BLAKE3,
7//! and stored with optional zstd compression. Identical content is automatically
8//! deduplicated across environments.
9//!
10//! ## Key Types
11//!
12//! - [`ContentHash`] - A 256-bit BLAKE3 content hash
13//! - [`ContentStore`] - On-disk content-addressable store
14//! - [`Manifest`] - File manifest (ordered list of chunk hashes)
15//! - [`GarbageCollector`] - Reference-counting garbage collector
16//!
17//! ## Example
18//!
19//! ```no_run
20//! use hd_cas::{ContentStore, ContentHash};
21//! use std::path::Path;
22//!
23//! let store = ContentStore::open(Path::new("/tmp/cas")).unwrap();
24//! let hash = store.put_file(Path::new("myfile.txt")).unwrap();
25//! store.get_file(&hash, Path::new("recovered.txt")).unwrap();
26//! ```
27
28pub mod hash;
29pub mod chunk;
30pub mod manifest;
31pub mod store;
32pub mod gc;
33
34// Re-export key types at crate root for convenience
35pub use hash::ContentHash;
36pub use manifest::Manifest;
37pub use store::ContentStore;
38pub use gc::{GarbageCollector, GcStats};