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
//! # spacedb-sdk — the developer's whole world
//!
//! One surface over the entire SpaceDB stack. You [`open`](Database::open) an
//! offline-first local replica, [`define`](Database::define) a [`Schema`] where
//! each field declares its [`CrdtType`] and consistency [`Tier`], and run ops that
//! are **mID-authorized**, **budget-bounded**, and **honest** — every write and
//! read returns the [`Outcome`] it actually achieved (`Local`, `Committed{tier}`,
//! `Stale{lag}`, `Unavailable{reason}`). Strong-tier fields go through a quorum
//! that fails safe under partition; reactive [`Watcher`]s and CRDT
//! [`export`](Database::export)/[`import`](Database::import) sync round it out.
//!
//! ```no_run
//! use spacedb_sdk::{Database, Schema, CrdtType, Tier, Identity};
//!
//! let owner = Identity::generate("did:mata:owner").unwrap();
//! let mut db = Database::open(Identity::generate("did:mata:home-1").unwrap());
//! db.register_identity(&owner).unwrap();
//! db.define(
//! Schema::new("profile")
//! .field("bio", CrdtType::Text, Tier::Convergent)
//! .field("username", CrdtType::Register, Tier::Strong),
//! );
//! ```
//!
//! Open-core (MIT). Composes `spacedb-crdt`, `-access`, `-consistency`, `-meter`.
pub use ;
pub use ;
pub use Session;
pub use Database;
// Re-export the stack types a developer composes with, so one `use` line suffices.
pub use ;
pub use ;
pub use Watcher;
pub use Budget;