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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
//! # spacedb-store — SpaceDB Layer 0
//!
//! The per-node storage **primitive**: a typed, transactional, order-preserving
//! key/value store that everything else in SpaceDB rests on. Getting this small
//! and correct is the whole game — every layer above inherits its guarantees.
//!
//! ## What S1 ships
//!
//! - [`KvEngine`] — the engine seam, with two implementations that share
//! identical transaction semantics: [`RedbEngine`] (durable) and [`MemEngine`]
//! (in-memory, for tests).
//! - [`codec`] — a deterministic `postcard` value codec and an order-preserving
//! key codec (`a < b ⟺ encode(a) < encode(b)`), each a verified bijection.
//! - [`Table`] — the typed `Table<K, V>` primitive that applies both codecs once
//! so layers above never touch raw bytes.
//!
//! ## Guarantees
//!
//! - **Atomic multi-table writes.** One [`WriteTx`] spans many tables and commits
//! all-or-nothing; dropping it rolls back.
//! - **Logical-order range scans**, courtesy of the order-preserving key codec.
//! - **Single-writer / snapshot reads**, identical across both engines.
//!
//! ## Open-core boundary
//!
//! `spacedb-store` is MIT and depends on **no** MATA crate. MATA-specific
//! capabilities (the vault key, identity, mesh replication, settlement) enter
//! later through *seams this crate defines* — e.g. the `KeyProvider` for the AEAD
//! boundary in S2 — which MATA implements in its proprietary hosted product. The
//! dependency arrow is MATA → SpaceDB, never the reverse.
pub use ;
pub use ;
pub use ;
pub use MemEngine;
// Native-only: redb needs real file I/O. Wasm builds use `MemEngine`; the host
// environment persists snapshots (e.g. IndexedDB in a browser) via its own adapter.
pub use RedbEngine;
pub use Table;
pub use ;
pub use Collection;
pub use ;
pub use ;
pub use ;
/// Compiles the README's examples as doctests, so the documented API can never
/// drift from the real one. Not part of the public API, and not rendered into
/// the crate docs — it exists only under `cargo test --doc`.
;