Expand description
§casq Core
A content-addressed file store (CAS) using BLAKE3 hashing.
This library provides the core functionality for storing and retrieving files and directories by their cryptographic hash. Objects are stored immutably with stable content IDs, using a tree-based directory representation.
§Features
- Content-addressed storage: files/dirs stored by hash
- Immutable objects with stable content IDs
- Tree-based directory representation
- Garbage collection for unreferenced objects
- Named references (refs) as GC roots
§Example
use casq_core::{Store, Algorithm};
use std::path::Path;
// Initialize a new store
let store = Store::init("./my-store", Algorithm::Blake3)?;
// Add a file or directory
let hash = store.add_path(Path::new("./my-data"))?;
// Create a reference to the root hash
store.refs().add("backup", &hash)?;
// Garbage collect unreferenced objects
let stats = store.gc(false)?;
println!("Deleted {} objects", stats.objects_deleted);
// Materialize back to filesystem
store.materialize(&hash, Path::new("./restored"))?;Structs§
- GcStats
- Statistics from a garbage collection run.
- Hash
- A 32-byte BLAKE3 hash digest.
- Journal
- Journal for tracking operations.
- Journal
Entry - A journal entry recording an operation.
- Object
Header - A 16-byte object header.
- Orphan
Root - Information about an orphaned object (blob or tree).
- RefManager
- Manages named references (GC roots) in the store.
- Store
- A content-addressed store.
- Tree
Entry - An entry in a tree (file or subdirectory).
Enums§
- Algorithm
- Supported hash algorithms.
- Entry
Type - Entry type in a tree.
- Error
- Errors that can occur during store operations.
- Object
Type - Object types.