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
//! [`LogProcessor`]: the write side of a replica.
use async_trait;
use crateDecodedEntry;
use crateHasCursors;
use crateUuid;
use SyncError;
/// The apply target of replication: absorbs entries addressed by `(peer, index)`.
///
/// Multi-writer — it accepts any origin, so it can relay and merge. (A file log,
/// which writes only its own origin, is [`FileLogSink`](super::FileLogSink)
/// instead.)
///
/// Entries for a peer must be applied in contiguous ascending order — a cursor
/// is a single high-water mark that can't hold a hole. An already-seen `index`
/// is an idempotent no-op ([`Applied::new`] `== false`), so multi-channel
/// redelivery is safe; an `index` beyond the next expected one is a gap and is
/// rejected.
///
/// `&self`: one processor is shared (`Arc<dyn LogProcessor>`) as the apply target
/// of several sources while also read as a [`LogSource`](super::LogSource), so it
/// mutates through interior mutability.
/// Outcome of [`LogProcessor::apply`].