pub struct SyncEngine<M: RecordMapper> { /* private fields */ }Implementations§
Source§impl<M: RecordMapper + 'static> SyncEngine<M>where
M::Item: 'static,
impl<M: RecordMapper + 'static> SyncEngine<M>where
M::Item: 'static,
pub fn ledger(&self) -> &Ledger
Sourcepub fn consent_request(&self) -> Option<ConsentRequest>
pub fn consent_request(&self) -> Option<ConsentRequest>
The scope change currently awaiting consent, if any. Durable: it survives a restart and
is also reported by PassOutcome::ConsentRequired.
Sourcepub fn grant_consent(
&mut self,
to: &str,
choice: ConsentChoice,
) -> SyncResult<()>
pub fn grant_consent( &mut self, to: &str, choice: ConsentChoice, ) -> SyncResult<()>
Record explicit consent to sync into the new account to (the to of the pending
ConsentRequest). Resets the ledger for the new scope (the old account’s cursor,
versions and queued deletions never reach it) and lets the next pass run. Refused when
nothing is pending, when to is not the pending target, or when the signed-in scope has
since moved on (the next pass then raises a fresh request).
Sourcepub fn note_changed(&mut self, id: &str) -> SyncResult<()>
pub fn note_changed(&mut self, id: &str) -> SyncResult<()>
Offline queue: record that id changed locally. Durable immediately.
Sourcepub fn note_deleted(&mut self, id: &str) -> SyncResult<()>
pub fn note_deleted(&mut self, id: &str) -> SyncResult<()>
Local deletion: block the id and queue a tombstone write. Durable.
Sourcepub fn request_full_replay_once(&mut self, flag: &str)
pub fn request_full_replay_once(&mut self, flag: &str)
Replay the whole zone once for flag (one-shot repair migrations).
Sourcepub fn run_pass(&mut self) -> PassReport
pub fn run_pass(&mut self) -> PassReport
Runs one sync pass and records it in SyncEngine::metrics.
Sourcepub fn status(&self) -> SyncStatus
pub fn status(&self) -> SyncStatus
Pass counters, ledger queue sizes and process resource usage, read now. No polling thread runs for this.
Sourcepub fn metrics(&self) -> SyncMetrics
pub fn metrics(&self) -> SyncMetrics
Cumulative pass counters and current ledger queue sizes.