Skip to main content

Crate crdt_store

Crate crdt_store 

Source
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

BackendFeature flagUse case
MemoryStore(always available)Testing, prototyping
SqliteStoresqliteEdge Linux, mobile, desktop
RedbStoreredbPure-Rust edge without C deps

Structs§

CrdtDb
High-level CRDT database with automatic versioning and migration.
CrdtDbBuilder
Builder for constructing a CrdtDb with custom configuration.
CrdtDbConfig
Configuration for CrdtDb.
DbInfo
Summary information about the entire database.
MemoryStore
In-memory storage backend.
NamespaceInfo
Summary information about a stored namespace.
Snapshot
A persisted snapshot for fast recovery.
StoredEvent
A stored event from the event log.

Enums§

DbError
Error type for CrdtDb operations.

Traits§

BatchOps
Extension trait for efficient batch operations.
CrdtVersioned
Marker trait for types that carry schema version information.
EventStore
Extension trait for backends that support append-only event logs.
StateStore
Core trait for state persistence (snapshots).
Transactional
Extension trait for backends that support atomic transactions.

Functions§

deserialize_event
Helper to deserialize an event payload.