Skip to main content

slipstream/
lib.rs

1//! Shared KV store abstraction for Beyond services.
2//!
3//! This crate provides a backend-agnostic interface for key-value storage,
4//! with NATS JetStream as the primary implementation.
5//!
6//! # Architecture
7//!
8//! ```text
9//! ┌─────────────────────────────────────────────────────────────┐
10//! │              KvReader │ KvWatcher │ KvWriter                │
11//! │                 (core KV operations)                        │
12//! ├─────────────────────────────────────────────────────────────┤
13//! │                        KvStore                              │
14//! │            (named bucket with reader/watcher/writer)        │
15//! ├─────────────────────────────────────────────────────────────┤
16//! │                       Connection                            │
17//! │              (lifecycle, store factory, capabilities)       │
18//! ├─────────────────────────────────────────────────────────────┤
19//! │                    NatsConnection                           │
20//! │               (concrete implementation)                     │
21//! └─────────────────────────────────────────────────────────────┘
22//! ```
23
24#![deny(unsafe_code)]
25
26mod applied;
27mod kv;
28mod nats;
29pub mod snapshot;
30mod stores;
31
32pub use applied::{BatchConfig, WatchScope, watch_applied};
33pub use kv::{
34    KvEntry, KvError, KvReader, KvTtl, KvUpdate, KvWatcher, KvWriter, VersionToken, WatchCursor,
35};
36pub use nats::{NatsConnection, NatsConnectionConfig, nats_connect};
37pub use stores::{Connection, ConnectionCapabilities, KvStore, StorageType, StoreConfig};