1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//! 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 use ;
pub use ;
pub use Codec;
pub use StoreError;
pub use SlotStore;
pub use IndexedDbBackend;
pub use RedbBackend;
pub use ZipBackend;
pub use JsonCodec;
pub use PostcardCodec;
/// [`SlotStore`] with the JSON codec, the friendly default.
pub type JsonSlots<B> = SlotStore;
/// [`SlotStore`] with the deterministic postcard codec.
pub type PostcardSlots<B> = SlotStore;