Skip to main content

Crate slipstream

Crate slipstream 

Source
Expand description

Shared KV store abstraction for Beyond services.

This crate provides a backend-agnostic interface for key-value storage, with NATS JetStream as the primary implementation.

§Architecture

┌─────────────────────────────────────────────────────────────┐
│              KvReader │ KvWatcher │ KvWriter                │
│                 (core KV operations)                        │
├─────────────────────────────────────────────────────────────┤
│                        KvStore                              │
│            (named bucket with reader/watcher/writer)        │
├─────────────────────────────────────────────────────────────┤
│                       Connection                            │
│              (lifecycle, store factory, capabilities)       │
├─────────────────────────────────────────────────────────────┤
│                    NatsConnection                           │
│               (concrete implementation)                     │
└─────────────────────────────────────────────────────────────┘

Re-exports§

pub use snapshot::AppendLogSnapshot;
pub use snapshot::SnapshotStore;

Modules§

snapshot
Append-only snapshot log for KV state.

Structs§

BatchConfig
Batching policy for watch_applied.
ConnectionCapabilities
Capabilities a store connection may support.
KvEntry
A single key-value entry with metadata.
NatsConnection
NATS JetStream KV connection.
NatsConnectionConfig
Configuration for NATS connection.
StoreConfig
Configuration for creating a store.
VersionToken
Opaque version token that abstracts store-specific versioning.
WatchCursor
Opaque position in a watch stream for resuming after disconnect.

Enums§

KvError
Error type for KV operations.
KvUpdate
Update event from a watch stream.
StorageType
Storage type for a store.
WatchScope
What to watch: every key, or every key under a prefix.

Traits§

Connection
Store connection lifecycle and store factory.
KvReader
Core read-only KV operations - the minimal interface every store must implement.
KvStore
A named KV store (bucket/namespace/database).
KvTtl
TTL support - optional, for stores that support key expiration.
KvWatcher
Watch capability - optional, not all stores support real-time updates.
KvWriter
Write operations - optional, edge proxy is primarily read-only.

Functions§

nats_connect
Connect to NATS with various authentication methods.
watch_applied
Drive a watch with cursor-after-apply semantics.