pub trait Backend: Send + Sync {
// Required methods
fn prepare(&self) -> SyncResult<()>;
fn fetch_changes(&self, since: Option<&[u8]>) -> SyncResult<ChangePage>;
fn fetch_record(&self, record_name: &str) -> SyncResult<Option<RawRecord>>;
fn save_records(
&self,
records: &[RawRecord],
policy: SavePolicy,
) -> SyncResult<Vec<RecordOutcome>>;
// Provided method
fn max_batch(&self) -> usize { ... }
}Expand description
The cloud zone. Method set mirrors the iOS CloudSyncService.
Required Methods§
Sourcefn prepare(&self) -> SyncResult<()>
fn prepare(&self) -> SyncResult<()>
Create zone/subscription (idempotent).
Sourcefn fetch_changes(&self, since: Option<&[u8]>) -> SyncResult<ChangePage>
fn fetch_changes(&self, since: Option<&[u8]>) -> SyncResult<ChangePage>
ONE delta page since since (None = first fetch). Report an expired
token as SyncError::TokenExpired and a missing zone as ZoneMissing.
Sourcefn fetch_record(&self, record_name: &str) -> SyncResult<Option<RawRecord>>
fn fetch_record(&self, record_name: &str) -> SyncResult<Option<RawRecord>>
Point read, used to obtain a change tag for a known record.
Sourcefn save_records(
&self,
records: &[RawRecord],
policy: SavePolicy,
) -> SyncResult<Vec<RecordOutcome>>
fn save_records( &self, records: &[RawRecord], policy: SavePolicy, ) -> SyncResult<Vec<RecordOutcome>>
Non-atomic batch save: one outcome per input. Err = whole call failed.
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".