Expand description
§Diaryx Sync Engine
Sync engine for Diaryx, providing CRDT types, sync protocol, and server infrastructure.
§Feature flags
- default — CRDT types and protocol only (WASM-compatible)
- sqlite — SQLite-backed CRDT storage
- server — Siphonophore hooks, axum WebSocket server, StorageCache
- native-sync — Native sync transport (tokio-tungstenite)
- git — Git-backed version history
Re-exports§
pub use materialize::MaterializationResult;pub use materialize::MaterializedFile;pub use materialize::materialize_workspace;pub use materialize::parse_snapshot_markdown;pub use sanity::IssueKind;pub use sanity::SanityIssue;pub use sanity::SanityReport;pub use sanity::validate_workspace;pub use self_healing::HealingAction;pub use self_healing::HealthTracker;pub use attachment_sync::AttachmentSyncClient;pub use control_message::ControlMessage;pub use share_session::HttpClient;pub use share_session::HttpResponse;pub use share_session::SessionCreatedResponse;pub use share_session::SessionInfoResponse;
Modules§
- attachment_
sync - Attachment sync client.
- control_
message - Control messages from the sync server (JSON over WebSocket text frames).
- materialize
- Workspace materialization — extract CRDT state into files.
- sanity
- Workspace sanity validation — detect CRDT state inconsistencies.
- self_
healing - Self-healing health tracker for workspace validation.
- share_
session - Live share session REST client.
Structs§
- Binary
Ref - Reference to a binary attachment file.
- BodyDoc
- A CRDT document for a single file’s body content.
- Body
DocManager - Manager for multiple body document CRDTs.
- Body
Sync Protocol - Sync protocol handler for a body document.
- Body
Sync Result - Result of handling a body sync message.
- CrdtFs
- A filesystem decorator that automatically updates the CRDT on file operations.
- Crdt
Update - A CRDT update record, stored for history and sync purposes.
- Decorated
Fs - A fully decorated filesystem with runtime control handles.
- Decorated
FsBuilder - Builder for constructing a decorated filesystem stack.
- Event
Only Fs - A lightweight decorated filesystem without CrdtFs.
- File
Diff - Difference between two versions of a file.
- File
Metadata - Metadata for a file in the workspace CRDT.
- Guest
Config - Configuration for guest mode sync.
- History
Entry - A history entry with metadata about what changed.
- History
Manager - Manager for version history operations.
- Memory
Storage - In-memory CRDT storage for testing.
- Rust
Sync Manager - Unified sync manager for workspace and body synchronization.
- Sync
Handler - Handler for sync side effects.
- Sync
Message Result - Result of handling a sync message.
- Sync
Plugin - Plugin that owns all CRDT state and handles sync commands.
- Sync
Protocol - Sync protocol handler for a workspace CRDT.
- Sync
Session - Message-driven sync session protocol handler.
- Sync
Session Config - Configuration for a sync session.
- Workspace
Crdt - A CRDT document representing the workspace file hierarchy.
Enums§
- Change
Type - Type of change made to a file.
- DocId
Kind - Parsed document ID kind for v2 protocol routing.
- Incoming
Event - Events fed into the session from the platform layer.
- Session
Action - Actions returned by
SyncSession::process()for the platform layer to execute. - Sync
Event - Events emitted by the sync session to the frontend.
- Sync
Message - Y-sync message types.
- Sync
Status - Current sync status.
- Update
Origin - Origin of a CRDT update, used to distinguish local vs remote changes.
Traits§
- Crdt
Storage - Trait for CRDT document storage backends.
Functions§
- format_
body_ doc_ id - Format a body document ID for the v2 protocol.
- format_
workspace_ doc_ id - Format a workspace document ID for the v2 protocol.
- frame_
body_ message - Frame a sync message with file path prefix for multiplexed transport.
- frame_
message_ v2 - Frame a message for v2 protocol with fixed u8 length prefix.
- parse_
doc_ id - Parse a v2 document ID into its components.
- unframe_
body_ message - Unframe a multiplexed body message.
- unframe_
message_ v2 - Unframe a v2 message with fixed u8 length prefix.
Type Aliases§
- Storage
Result - Result type for storage operations.