Skip to main content

Crate choir_store

Crate choir_store 

Source
Expand description

L0 content-addressed store: BLAKE3 + FastCDC chunking (DECISIONS.md D6).

One-way-door rules (DECISIONS.md) enforced here:

  • manifests carry format_version and record the exact chunking parameters used, per object, so parameter changes never orphan data
  • all identifiers are self-describing ContentHash envelopes

The chunk-store seam (D7) is ChunkStore; the production backend is an S3-compatible object store, so implementations must stay within plain put/get/has semantics.

§Examples

use choir_store::{ChunkerParams, MemStore, put_blob, get_blob};

let mut store = MemStore::new();
let data = vec![7u8; 100_000];
let manifest_hash = put_blob(&mut store, &data, ChunkerParams::default()).unwrap();
assert_eq!(get_blob(&store, &manifest_hash).unwrap(), data);

§Where this sits

docs/architecture.md is the map of the whole workspace. This crate is L0, the content-addressed store.

It builds on choir_hash.

Structs§

ChunkerParams
FastCDC parameters, recorded per object (one-way-door rule, D6): a blob is always rechunkable for verification because its manifest says exactly how it was cut.
FsStore
Second implementation (seam rule): filesystem store, one file per chunk, sharded by the first digest byte.
Manifest
A blob’s recipe: ordered chunk addresses plus the parameters that cut it.
MemStore
Primary in-memory implementation (also the dev/test runtime).

Enums§

StoreError
Failure modes of a ChunkStore or blob operation.

Constants§

FORMAT_VERSION
Current manifest-format version. Bump on any incompatible change; additive changes keep the version (DECISIONS.md).

Traits§

ChunkStore
The chunk-store seam (D7). Conformance suite: tests/conformance.rs.

Functions§

get_blob
Reassembles a blob from its manifest address, verifying every chunk.
put_blob
Chunks data with FastCDC under params, stores every chunk and the manifest, and returns the manifest’s content address.