muniment 0.1.2

A portable persistence store: a host-supplied byte-backend seam (filesystem, OPFS, redb, fjall), typed mutable slots over a pluggable codec, and content-addressed immutable blobs. Format-agnostic and wasm-friendly. The storage floor for versioned user content; sibling to codicil (the append-only log).
Documentation
//! muniment — a portable persistence store.
//!
//! A muniment room is where a household keeps its records: the deeds and
//! documents preserved as evidence. This crate is that room for an app's durable
//! state, and nothing more.
//!
//! Three pieces over one seam:
//!
//! - [`Backend`] is the host-supplied byte store. The host realizes it as the
//!   filesystem on desktop, OPFS in the browser, or an embedded store (redb,
//!   fjall). It is `async` and `?Send` so a browser main thread can await OPFS
//!   promises; desktop backends return ready futures and pay nothing. muniment
//!   ships only [`MemoryBackend`], the in-memory test floor.
//! - [`SlotStore`] holds typed **mutable named slots**: `save` overwrites, `load`
//!   returns the latest. The current-session, current-campaign, current-project
//!   pattern. Serialized through a pluggable [`Codec`] (JSON or postcard here,
//!   your own otherwise), so muniment mandates no wire format.
//! - [`BlobStore`] holds **content-addressed immutable blobs**: `put` returns a
//!   blake3 [`Hash`], `get` fetches by it. Identical content is stored once; a
//!   new version is new bytes with a new hash, never a mutation.
//!
//! muniment holds bytes; it does not model what they mean. The append-only log
//! that versions them is its sibling, codicil; the note-and-tag content model is
//! a layer above both.

pub mod backend;
pub mod blob;
pub mod codec;
pub mod error;
#[cfg(all(feature = "indexeddb", target_arch = "wasm32"))]
pub mod indexeddb_backend;
#[cfg(feature = "redb")]
pub mod redb_backend;
pub mod slot;
#[cfg(feature = "zip")]
pub mod zip_backend;

pub use backend::{Backend, MemoryBackend, WriteOp};
pub use blob::{BlobStore, Hash};
pub use codec::Codec;
pub use error::StoreError;
pub use slot::SlotStore;

#[cfg(all(feature = "indexeddb", target_arch = "wasm32"))]
pub use indexeddb_backend::IndexedDbBackend;

#[cfg(feature = "redb")]
pub use redb_backend::RedbBackend;

#[cfg(feature = "zip")]
pub use zip_backend::ZipBackend;

#[cfg(feature = "json")]
pub use codec::JsonCodec;
#[cfg(feature = "postcard")]
pub use codec::PostcardCodec;

/// [`SlotStore`] with the JSON codec, the friendly default.
#[cfg(feature = "json")]
pub type JsonSlots<B> = slot::SlotStore<B, codec::JsonCodec>;

/// [`SlotStore`] with the deterministic postcard codec.
#[cfg(feature = "postcard")]
pub type PostcardSlots<B> = slot::SlotStore<B, codec::PostcardCodec>;