SyncEngine

Struct SyncEngine 

Source
pub struct SyncEngine<T: SyncTransport, A: SyncApplier> { /* private fields */ }
Expand description

The sync engine manages synchronization with a remote server.

Implementations§

Source§

impl<T: SyncTransport, A: SyncApplier> SyncEngine<T, A>

Source

pub fn new(config: SyncConfig, transport: T, applier: A) -> Self

Creates a new sync engine.

Source

pub fn state(&self) -> SyncState

Gets the current state.

Source

pub fn stats(&self) -> SyncStats

Gets the current stats.

Source

pub fn set_conflict_policy(&self, policy: ConflictPolicy)

Sets the conflict policy.

Source

pub fn conflict_policy(&self) -> ConflictPolicy

Gets the conflict policy.

Source

pub fn cancel(&self)

Cancels any ongoing sync operation.

Source

pub fn reset_cancel(&self)

Resets the cancelled flag.

Source

pub fn sync(&self) -> SyncResult<SyncCycleResult>

Performs a full sync cycle: pull then push.

Source

pub fn sync_with_retry(&self) -> SyncResult<SyncCycleResult>

Performs a sync with retry on transient errors.

Auto Trait Implementations§

§

impl<T, A> !Freeze for SyncEngine<T, A>

§

impl<T, A> !RefUnwindSafe for SyncEngine<T, A>

§

impl<T, A> Send for SyncEngine<T, A>

§

impl<T, A> Sync for SyncEngine<T, A>

§

impl<T, A> Unpin for SyncEngine<T, A>

§

impl<T, A> UnwindSafe for SyncEngine<T, A>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.