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
//! Per-origin replication cursors — the version vector replicas exchange.
use HashMap;
use Pin;
use async_trait;
use Stream;
use crateUuid;
use SyncError;
/// Per-origin position: `peer id → next entry index`. The value for a peer is
/// what to pass [`read_since`](super::LogSource::read_since) for the next entry;
/// an absent key means `0`.
///
/// A version vector: merge by pointwise `max`, diff to get the gap to pull.
pub type PeerCursors = ;
/// An event from [`watch_cursors`](HasCursors::watch_cursors).
///
/// First event is a full `Snapshot`, later events `Advanced` deltas of the
/// origins that moved; fold each in by pointwise `max`. Carrying cursor state
/// (not entries) makes it loss-tolerant: a dropped or coalesced event costs
/// nothing — the next one still names the current position, and the gap is
/// refetched via `read_since`.
/// Stream from [`watch_cursors`](HasCursors::watch_cursors); ending means the
/// watch closed.
pub type CursorStream = ;
/// Snapshot or watch a replica's cursor vector — the shared base of
/// [`LogProcessor`](super::LogProcessor) and [`LogSource`](super::LogSource).