Skip to main content

Crate diaryx_sync

Crate diaryx_sync 

Source
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;
pub use share_session::ShareSessionClient;

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§

BinaryRef
Reference to a binary attachment file.
BodyDoc
A CRDT document for a single file’s body content.
BodyDocManager
Manager for multiple body document CRDTs.
BodySyncProtocol
Sync protocol handler for a body document.
BodySyncResult
Result of handling a body sync message.
CrdtFs
A filesystem decorator that automatically updates the CRDT on file operations.
CrdtUpdate
A CRDT update record, stored for history and sync purposes.
DecoratedFs
A fully decorated filesystem with runtime control handles.
DecoratedFsBuilder
Builder for constructing a decorated filesystem stack.
EventOnlyFs
A lightweight decorated filesystem without CrdtFs.
FileDiff
Difference between two versions of a file.
FileMetadata
Metadata for a file in the workspace CRDT.
GuestConfig
Configuration for guest mode sync.
HistoryEntry
A history entry with metadata about what changed.
HistoryManager
Manager for version history operations.
MemoryStorage
In-memory CRDT storage for testing.
RustSyncManager
Unified sync manager for workspace and body synchronization.
SyncHandler
Handler for sync side effects.
SyncMessageResult
Result of handling a sync message.
SyncPlugin
Plugin that owns all CRDT state and handles sync commands.
SyncProtocol
Sync protocol handler for a workspace CRDT.
SyncSession
Message-driven sync session protocol handler.
SyncSessionConfig
Configuration for a sync session.
WorkspaceCrdt
A CRDT document representing the workspace file hierarchy.

Enums§

ChangeType
Type of change made to a file.
DocIdKind
Parsed document ID kind for v2 protocol routing.
IncomingEvent
Events fed into the session from the platform layer.
SessionAction
Actions returned by SyncSession::process() for the platform layer to execute.
SyncEvent
Events emitted by the sync session to the frontend.
SyncMessage
Y-sync message types.
SyncStatus
Current sync status.
UpdateOrigin
Origin of a CRDT update, used to distinguish local vs remote changes.

Traits§

CrdtStorage
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§

StorageResult
Result type for storage operations.