Skip to main content

Crate rightkit_sync

Crate rightkit_sync 

Source
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/1 line-JSON protocol. The macOS CloudKit helper (rightkit-cloudkit-helper, Swift) is the production implementation; rightkit-sync-fake-helper is the protocol fake used by the end-to-end tests. See API.md section 4.

Structs§

AlwaysAvailable
BackoffPolicy
Deterministic exponential backoff merged with server hints.
ChangePage
FileStorage
Atomic, durable, owner-only write (temp file, fsync, rename, fsync directory) to one file, through rightkit_fs::atomic_write_private.
ItemHeader
Immutable identity + version of one syncable item.
LastWriterWins
Ledger
LedgerStore
MemoryBackend
MemoryStorage
Clonable in-memory storage; clones share bytes (simulates an app restart).
NoHooks
NullObserver
PassReport
RawRecord
RecordOutcome
RemoteVersion
SyncConfig
SyncEngine
SyncEngineBuilder
SyncMetrics
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.
SyncStatus
Runtime figures of the engine, computed on call by SyncEngine::status.
SystemClock

Enums§

ApplyOutcome
Result of landing one downloaded item locally.
FieldValue
PassOutcome
SavePolicy
SyncError

Traits§

AuthProvider
Account state and session credentials. generation changes on account switch; an in-flight pass observing a different generation cancels itself.
Backend
The cloud zone. Method set mirrors the iOS CloudSyncService.
Clock
ConflictPolicy
Last-writer-wins by default. Tombstones and duplicate-alias reduction are fixed by the shared contract and not pluggable here.
LedgerStorage
LocalStore
The app’s local data. All calls are synchronous.
PassHooks
Optional domain extension for record types the engine does not own (device announcements, request queues, …).
RecordMapper
Domain <-> wire mapping for the one syncable item type.
SyncObserver
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 their id field.
write_tombstone
Tombstone convention shared with HeardRight iOS: keep id, updatedAt (= deletion time) and deletedAt; clear every other field except keep. Decoders must not require any other field on a tombstone.

Type Aliases§

Extras
Durable app-owned scratch the engine persists inside its ledger.
SyncResult