pub struct SyncManager { /* private fields */ }Expand description
Main synchronization manager
Implementations§
Source§impl SyncManager
impl SyncManager
Sourcepub async fn new() -> Result<Self, QueryError>
pub async fn new() -> Result<Self, QueryError>
Create a new sync manager
Sourcepub async fn store_with_crdt<T>(
&mut self,
key: &QueryKey,
data: T,
) -> Result<(), QueryError>
pub async fn store_with_crdt<T>( &mut self, key: &QueryKey, data: T, ) -> Result<(), QueryError>
Store data with CRDT capabilities
Sourcepub async fn get_with_crdt<T>(
&self,
key: &QueryKey,
) -> Result<Option<T>, QueryError>where
T: DeserializeOwned,
pub async fn get_with_crdt<T>(
&self,
key: &QueryKey,
) -> Result<Option<T>, QueryError>where
T: DeserializeOwned,
Retrieve data with CRDT capabilities
Sourcepub async fn resolve_conflicts(
&mut self,
key: &QueryKey,
strategy: ConflictResolutionStrategy,
) -> Result<(), QueryError>
pub async fn resolve_conflicts( &mut self, key: &QueryKey, strategy: ConflictResolutionStrategy, ) -> Result<(), QueryError>
Resolve conflicts using specified strategy
Sourcepub fn set_network_status(&mut self, status: NetworkStatus)
pub fn set_network_status(&mut self, status: NetworkStatus)
Set network status
Sourcepub async fn queue_operation<T>(
&mut self,
key: &QueryKey,
data: T,
) -> Result<Option<OperationId>, QueryError>
pub async fn queue_operation<T>( &mut self, key: &QueryKey, data: T, ) -> Result<Option<OperationId>, QueryError>
Queue operation while offline
Sourcepub fn has_pending_operations(&self) -> bool
pub fn has_pending_operations(&self) -> bool
Check if there are pending operations
Sourcepub fn pending_operation_count(&self) -> usize
pub fn pending_operation_count(&self) -> usize
Get count of pending operations
Sourcepub async fn process_queued_operations(&mut self) -> Result<(), QueryError>
pub async fn process_queued_operations(&mut self) -> Result<(), QueryError>
Process queued operations
Sourcepub async fn merge_with(
&mut self,
other: &mut SyncManager,
) -> Result<(), QueryError>
pub async fn merge_with( &mut self, other: &mut SyncManager, ) -> Result<(), QueryError>
Merge with another sync manager
Sourcepub async fn detect_conflicts(
&self,
key: &QueryKey,
) -> Result<Vec<Conflict>, QueryError>
pub async fn detect_conflicts( &self, key: &QueryKey, ) -> Result<Vec<Conflict>, QueryError>
Detect conflicts for a given key
Sourcepub async fn auto_sync(&mut self) -> Result<SyncResult, QueryError>
pub async fn auto_sync(&mut self) -> Result<SyncResult, QueryError>
Perform automatic synchronization
Auto Trait Implementations§
impl Freeze for SyncManager
impl RefUnwindSafe for SyncManager
impl Send for SyncManager
impl Sync for SyncManager
impl Unpin for SyncManager
impl UnwindSafe for SyncManager
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> SerializableKey for T
impl<T> SerializableKey for T
Source§impl<T> StorageAccess<T> for T
impl<T> StorageAccess<T> for T
Source§fn as_borrowed(&self) -> &T
fn as_borrowed(&self) -> &T
Borrows the value.
Source§fn into_taken(self) -> T
fn into_taken(self) -> T
Takes the value.