Expand description
Brand-neutral cloud sync engine. See API.md for the adapter traits and
the record/conflict contract shared with the iOS CloudKit implementation.
Modules§
- field
- helper
- Backend for a helper process speaking the
rightkit-sync-helper/1line-JSON protocol. The macOS CloudKit helper (rightkit-cloudkit-helper, Swift) is the production implementation;rightkit-sync-fake-helperis the protocol fake used by the end-to-end tests. SeeAPI.mdsection 4.
Structs§
- Always
Available - Backoff
Policy - Deterministic exponential backoff merged with server hints.
- Change
Page - File
Storage - Atomic, durable, owner-only write (temp file, fsync, rename, fsync directory) to one file,
through
rightkit_fs::atomic_write_private. - Item
Header - Immutable identity + version of one syncable item.
- Last
Writer Wins - Ledger
- Ledger
Store - Memory
Backend - Memory
Storage - Clonable in-memory storage; clones share bytes (simulates an app restart).
- NoHooks
- Null
Observer - Pass
Report - RawRecord
- Record
Outcome - Remote
Version - Sync
Config - Sync
Engine - Sync
Engine Builder - Sync
Metrics - Cumulative engine counters and current ledger queue sizes, from
SyncEngine::metrics. Queue sizes are the figures that grow resident memory: the ledger keeps one remote version per record and is serialized in full on every durable write. - Sync
Status - Runtime figures of the engine, computed on call by
SyncEngine::status. - System
Clock
Enums§
- Apply
Outcome - Result of landing one downloaded item locally.
- Field
Value - Pass
Outcome - Save
Policy - Sync
Error
Traits§
- Auth
Provider - Account state and session credentials.
generationchanges on account switch; an in-flight pass observing a different generation cancels itself. - Backend
- The cloud zone. Method set mirrors the iOS
CloudSyncService. - Clock
- Conflict
Policy - Last-writer-wins by default. Tombstones and duplicate-alias reduction are fixed by the shared contract and not pluggable here.
- Ledger
Storage - Local
Store - The app’s local data. All calls are synchronous.
- Pass
Hooks - Optional domain extension for record types the engine does not own (device announcements, request queues, …).
- Record
Mapper - Domain <-> wire mapping for the one syncable item type.
- Sync
Observer - Free-form diagnostics hook (no logging dependency baked in).
Functions§
- read_
tombstone (id, deletedAt)when the record is a tombstone. The id falls back to the record name for legacy tombstones that lost theiridfield.- write_
tombstone - Tombstone convention shared with HeardRight iOS: keep
id,updatedAt(= deletion time) anddeletedAt; clear every other field exceptkeep. Decoders must not require any other field on a tombstone.
Type Aliases§
- Extras
- Durable app-owned scratch the engine persists inside its ledger.
- Sync
Result