pub struct EndToEndSyncManager<S, T>{ /* private fields */ }Expand description
End-to-end synchronization manager
Implementations§
Source§impl<S, T> EndToEndSyncManager<S, T>where
S: LocalStorage + Send + Sync + 'static,
T: SyncTransport + Send + Sync + 'static,
EndToEndSyncError: From<<T as SyncTransport>::Error>,
impl<S, T> EndToEndSyncManager<S, T>where
S: LocalStorage + Send + Sync + 'static,
T: SyncTransport + Send + Sync + 'static,
EndToEndSyncError: From<<T as SyncTransport>::Error>,
Sourcepub fn new(
replica_id: ReplicaId,
storage: Arc<S>,
transport: Arc<T>,
sync_interval: Duration,
heartbeat_interval: Duration,
) -> Self
pub fn new( replica_id: ReplicaId, storage: Arc<S>, transport: Arc<T>, sync_interval: Duration, heartbeat_interval: Duration, ) -> Self
Create a new end-to-end sync manager
Sourcepub async fn start(&self) -> Result<(), EndToEndSyncError>
pub async fn start(&self) -> Result<(), EndToEndSyncError>
Start the synchronization manager
Sourcepub async fn stop(&self) -> Result<(), EndToEndSyncError>
pub async fn stop(&self) -> Result<(), EndToEndSyncError>
Stop the synchronization manager
Sourcepub async fn add_collection(
&self,
metadata: CollectionMetadata,
) -> Result<(), EndToEndSyncError>
pub async fn add_collection( &self, metadata: CollectionMetadata, ) -> Result<(), EndToEndSyncError>
Add a collection to synchronize
Sourcepub async fn remove_collection(
&self,
collection_id: &str,
) -> Result<(), EndToEndSyncError>
pub async fn remove_collection( &self, collection_id: &str, ) -> Result<(), EndToEndSyncError>
Remove a collection from synchronization
Sourcepub async fn get_collection(
&self,
collection_id: &str,
) -> Result<Option<CollectionMetadata>, EndToEndSyncError>
pub async fn get_collection( &self, collection_id: &str, ) -> Result<Option<CollectionMetadata>, EndToEndSyncError>
Get collection metadata
Sourcepub async fn list_collections(
&self,
) -> Result<Vec<CollectionMetadata>, EndToEndSyncError>
pub async fn list_collections( &self, ) -> Result<Vec<CollectionMetadata>, EndToEndSyncError>
List all collections
Sourcepub async fn get_peer(
&self,
peer_id: &ReplicaId,
) -> Result<Option<PeerInfo>, EndToEndSyncError>
pub async fn get_peer( &self, peer_id: &ReplicaId, ) -> Result<Option<PeerInfo>, EndToEndSyncError>
Get peer information
Sourcepub async fn list_peers(&self) -> Result<Vec<PeerInfo>, EndToEndSyncError>
pub async fn list_peers(&self) -> Result<Vec<PeerInfo>, EndToEndSyncError>
List all peers
Sourcepub async fn get_sync_state(&self) -> SyncState
pub async fn get_sync_state(&self) -> SyncState
Get current sync state
Sourcepub async fn is_running(&self) -> bool
pub async fn is_running(&self) -> bool
Check if the manager is running
Trait Implementations§
Source§impl<S, T> Clone for EndToEndSyncManager<S, T>where
S: LocalStorage + Send + Sync + 'static,
T: SyncTransport + Send + Sync + 'static,
EndToEndSyncError: From<<T as SyncTransport>::Error>,
impl<S, T> Clone for EndToEndSyncManager<S, T>where
S: LocalStorage + Send + Sync + 'static,
T: SyncTransport + Send + Sync + 'static,
EndToEndSyncError: From<<T as SyncTransport>::Error>,
Auto Trait Implementations§
impl<S, T> !RefUnwindSafe for EndToEndSyncManager<S, T>
impl<S, T> !UnwindSafe for EndToEndSyncManager<S, T>
impl<S, T> Freeze for EndToEndSyncManager<S, T>
impl<S, T> Send for EndToEndSyncManager<S, T>
impl<S, T> Sync for EndToEndSyncManager<S, T>
impl<S, T> Unpin for EndToEndSyncManager<S, T>
impl<S, T> UnsafeUnpin for EndToEndSyncManager<S, T>
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