meridian-client is the official Rust SDK for Meridian. It exposes the same eight CRDT handles as the TypeScript SDK, wrapped in a fully async, Arc-backed API built on Tokio.
Installation
Add to yourCargo.toml:
Connect
MeridianClient::connect returns Arc<MeridianClient> — cheap to clone across tasks.
CRDT handles
Every handle is obtained from the client and shares state viaArc. Calling the same method twice with the same CRDT ID returns handles backed by the same inner state.
GCounter
PNCounter
LwwRegister
ORSet
Presence
Awareness
RGA (collaborative text)
Tree
Live queries
Reconnection & offline
The WebSocket transport reconnects automatically with exponential backoff (100 ms → 30 s, ×2, ±25 % jitter). Ops sent while disconnected are queued and replayed once the connection is restored.Testing with FakeTransport
UseFakeTransport to unit-test your application logic without a real server:
Example — Ratatui leaderboard
The repository ships a full terminal leaderboard example inexamples/ratatui-game/ demonstrating:
- Multiple players each with their own GCounter
- Live leaderboard updated on every remote change
- Offline-resilient — reconnects automatically
Features
| Feature | Default | Description |
|---|---|---|
ws | ✅ | WebSocket transport via tokio-tungstenite |
ws and inject a custom Transport impl for embedded or test environments: