Expand description
§crdt-store
Persistence backends for crdt-kit.
Provides a unified storage abstraction for persisting CRDT state and
operation event logs across different backends: SQLite, redb, in-memory,
and raw flash (for no_std IoT).
§Quick Start
use crdt_store::{MemoryStore, StateStore};
let mut store = MemoryStore::new();
store.put("sensors", "sensor-42", b"hello").unwrap();
let data = store.get("sensors", "sensor-42").unwrap();
assert_eq!(data.as_deref(), Some(b"hello".as_slice()));§Backends
| Backend | Feature flag | Use case |
|---|---|---|
MemoryStore | (always available) | Testing, prototyping |
SqliteStore | sqlite | Edge Linux, mobile, desktop |
RedbStore | redb | Pure-Rust edge without C deps |
Structs§
- CrdtDb
- High-level CRDT database with automatic versioning and migration.
- Crdt
DbBuilder - Builder for constructing a
CrdtDbwith custom configuration. - Crdt
DbConfig - Configuration for
CrdtDb. - DbInfo
- Summary information about the entire database.
- Memory
Store - In-memory storage backend.
- Namespace
Info - Summary information about a stored namespace.
- Snapshot
- A persisted snapshot for fast recovery.
- Stored
Event - A stored event from the event log.
Enums§
- DbError
- Error type for
CrdtDboperations.
Traits§
- Batch
Ops - Extension trait for efficient batch operations.
- Crdt
Versioned - Marker trait for types that carry schema version information.
- Event
Store - Extension trait for backends that support append-only event logs.
- State
Store - Core trait for state persistence (snapshots).
- Transactional
- Extension trait for backends that support atomic transactions.
Functions§
- deserialize_
event - Helper to deserialize an event payload.