Module persistence
Expand description
Session persistence: backend-agnostic configuration and runtime dispatch.
SessionPersistence is the configuration passed to
ClientBuilder::persistence. Build it
from a dedicated backend builder (FilePersistence or, with the turso
feature, TursoPersistence), which each expose only their own options;
they convert into a SessionPersistence via From.
At connect time it is turned into a Persistence, the runtime backend the
connection event loop drives via Persistence::persist. This module knows
nothing about any particular backend’s storage; each backend module owns its
config, runtime store, and build. All backends share the same retry-safe
contract: accumulated ops are cleared from the in-memory session only once
they have been durably persisted, so a failed write keeps them buffered for
the next attempt.
Modules§
- file 🔒
- CRC-framed journal-file persistence backend.
- turso 🔒
turso - Optional [
turso] persistence backend.
Structs§
- File
Persistence - Configures session persistence backed by a CRC-framed journal file.
- Session
Persistence - How a client’s session is durably persisted across restarts.
- Turso
Persistence turso - Configures session persistence backed by a turso database.
Enums§
- Inner 🔒
- The selected backend. Hidden so the variant set stays private: callers only construct (via the backend builders), never match.
- Persistence 🔒
- The runtime backend a connection persists its session ops to.