pub struct SyncManager<S: CheckpointStore> { /* private fields */ }Expand description
Manager for handling sync operations with checkpoint tracking.
The SyncManager is generic over the checkpoint store type S,
providing storage-agnostic checkpoint management.
Implementations§
Source§impl<S: CheckpointStore> SyncManager<S>
impl<S: CheckpointStore> SyncManager<S>
Sourcepub fn new(store: S) -> Self
pub fn new(store: S) -> Self
Create a new sync manager with the given store.
By default, checkpoint emission is enabled.
Sourcepub fn new_without_emit(store: S) -> Self
pub fn new_without_emit(store: S) -> Self
Create a new sync manager with checkpoint emission disabled.
Sourcepub fn with_emit_checkpoints(self, emit: bool) -> Self
pub fn with_emit_checkpoints(self, emit: bool) -> Self
Set whether to emit checkpoints.
Sourcepub fn emit_checkpoints(&self) -> bool
pub fn emit_checkpoints(&self) -> bool
Check if checkpoint emission is enabled.
Sourcepub async fn emit_checkpoint<C: Checkpoint>(
&self,
checkpoint: &C,
phase: SyncPhase,
) -> Result<()>
pub async fn emit_checkpoint<C: Checkpoint>( &self, checkpoint: &C, phase: SyncPhase, ) -> Result<()>
Emit checkpoint for any database-specific checkpoint type.
Sourcepub async fn read_checkpoint<C: Checkpoint>(
&self,
phase: SyncPhase,
) -> Result<C>
pub async fn read_checkpoint<C: Checkpoint>( &self, phase: SyncPhase, ) -> Result<C>
Read and parse checkpoint into database-specific type.
Auto Trait Implementations§
impl<S> Freeze for SyncManager<S>where
S: Freeze,
impl<S> RefUnwindSafe for SyncManager<S>where
S: RefUnwindSafe,
impl<S> Send for SyncManager<S>
impl<S> Sync for SyncManager<S>
impl<S> Unpin for SyncManager<S>where
S: Unpin,
impl<S> UnsafeUnpin for SyncManager<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for SyncManager<S>where
S: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more