pub struct WebSocketSyncEngine { /* private fields */ }Expand description
WebSocket-integrated sync engine
Implementations§
Source§impl WebSocketSyncEngine
impl WebSocketSyncEngine
Sourcepub fn new(
storage: Storage,
config: WebSocketIntegrationConfig,
replica_id: ReplicaId,
) -> Self
pub fn new( storage: Storage, config: WebSocketIntegrationConfig, replica_id: ReplicaId, ) -> Self
Create a new WebSocket sync engine
Sourcepub async fn start(&self) -> Result<(), WebSocketIntegrationError>
pub async fn start(&self) -> Result<(), WebSocketIntegrationError>
Start the WebSocket sync engine
Sourcepub async fn stop(&self) -> Result<(), WebSocketIntegrationError>
pub async fn stop(&self) -> Result<(), WebSocketIntegrationError>
Stop the WebSocket sync engine
Sourcepub async fn send_delta(
&self,
collection_id: String,
crdt_type: CrdtType,
delta: Vec<u8>,
) -> Result<(), WebSocketIntegrationError>
pub async fn send_delta( &self, collection_id: String, crdt_type: CrdtType, delta: Vec<u8>, ) -> Result<(), WebSocketIntegrationError>
Send a CRDT delta to peers
Sourcepub fn sync_engine(&self) -> &Arc<SyncEngine<WebSocketClient>>
pub fn sync_engine(&self) -> &Arc<SyncEngine<WebSocketClient>>
Get the underlying sync engine
Sourcepub fn websocket_client(&self) -> &Arc<WebSocketClient>
pub fn websocket_client(&self) -> &Arc<WebSocketClient>
Get the WebSocket client
Sourcepub async fn is_running(&self) -> bool
pub async fn is_running(&self) -> bool
Check if the engine is running
Sourcepub async fn is_connected(&self) -> bool
pub async fn is_connected(&self) -> bool
Get connection status
Auto Trait Implementations§
impl !RefUnwindSafe for WebSocketSyncEngine
impl !UnwindSafe for WebSocketSyncEngine
impl Freeze for WebSocketSyncEngine
impl Send for WebSocketSyncEngine
impl Sync for WebSocketSyncEngine
impl Unpin for WebSocketSyncEngine
impl UnsafeUnpin for WebSocketSyncEngine
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