muniment
A portable persistence store. One host-supplied byte Backend seam (filesystem,
OPFS, redb, fjall), typed mutable SlotStore slots over a pluggable codec,
content-addressed immutable BlobStore blobs, and append-only Journal<T>
histories. Format-agnostic and wasm-friendly. The storage floor a small app
keeps its durable state in.
use ;
# block_on.unwrap;
Modules
| Module | Contents |
|---|---|
backend |
Backend (get, put, delete, list, scan, apply), WriteOp, MemoryBackend |
slot |
SlotStore<B, C>: save, load, delete, keys |
blob |
BlobStore<B>: put, get, has; Hash (blake3, of / as_bytes / to_hex / from_hex) |
codec |
Codec, JsonCodec, PostcardCodec |
error |
StoreError |
journal |
Journal<T>, Seq, causal links, fork provenance, and slot-backed persistence |
redb_backend |
RedbBackend (feature redb) |
fjall_backend |
FjallStore (feature fjall, native only) |
zip_backend |
ZipBackend (feature zip) |
indexeddb_backend |
IndexedDbBackend (feature indexeddb, wasm32 only) |
Type aliases JsonSlots<B> and PostcardSlots<B> pair SlotStore with the
matching codec.
Features
| Feature | Default | Effect |
|---|---|---|
json |
yes | JsonCodec and JsonSlots via serde_json |
postcard |
no | PostcardCodec and PostcardSlots |
redb |
no | RedbBackend, the durable desktop store |
fjall |
no | FjallStore, a native LSM key/value backend. Its default partition remains eidetic for existing stores; open_partition accepts other names |
zip |
no | ZipBackend, a zip archive whose entries are the store's keys |
indexeddb |
no | IndexedDbBackend. Its js-sys / wasm-bindgen / web-sys / futures-channel deps are declared for wasm32 only, so enabling it in a shared feature set is a no-op on desktop |
The Backend is async and ?Send so a browser main thread can await OPFS
promises, while desktop backends return ready futures. scan is an ordered
half-open range read; apply commits a batch of WriteOps, atomically where the
backend has transactions. Journal<T> supplies replayable order without taking
ownership of the events' domain meaning.
Built from a survey of four consumers (woodshed, hocket, isometry, mere), each
of which was hand-rolling this seam. The former standalone codicil log now
lives here as the plainly named Journal<T>. See design_docs/.
The name: a muniment room is where a household keeps its deeds and records, the documents preserved as evidence.
License: MPL-2.0 (see LICENSE).