1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//! Pluggable transport trait for the sync protocol.
//!
//! Consumers choose their transport: in-memory for testing,
//! HTTP for production, WebSocket for real-time sync.
//! PulseDB provides the trait; consumers (or feature-gated modules)
//! provide implementations.
use async_trait;
use SyncError;
use ;
/// Transport layer for the sync protocol.
///
/// Implementations handle the wire protocol for exchanging sync data
/// between PulseDB instances. The sync engine calls these methods;
/// the transport handles serialization, networking, and authentication.
///
/// # Implementations
///
/// - [`super::transport_mem::InMemorySyncTransport`] — In-memory for testing
/// - `HttpSyncTransport` — HTTP/HTTPS (behind `sync-http` feature, Phase 4)
/// - `WebSocketSyncTransport` — WebSocket (behind `sync-websocket` feature, Phase 4)
///
/// # Example
///
/// ```rust
/// use pulsedb::sync::transport::SyncTransport;
/// use pulsedb::sync::transport_mem::InMemorySyncTransport;
///
/// let (local, remote) = InMemorySyncTransport::new_pair();
/// // local and remote can now exchange sync data via shared buffer
/// ```