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
//! The file-log flavor: single-writer, multi-reader logs on shared storage.
//!
//! A file log is append-only segment directories on cloud storage, one per
//! origin. Only the originating device writes its own log. These traits encode
//! that: a file log reads any origin ([`FileLogPuller`] / [`LogSource`]) but
//! writes only its own ([`FileLogSink`]), so it's a [`FileLogReplica`], never a
//! full [`Replica`](super::Replica). Single-writer files are why dumb file sync
//! suffices and each log's extent is a trustworthy cursor.
use crateDecodedEntry;
use crateLogEntry;
use crateUuid;
use SyncError;
use LogSource;
/// Synchronous reader over the segment directories — one per origin. Sync
/// because it decodes local files; an adapter pairs it with a watch/poll loop to
/// present it as an async [`LogSource`].
/// Write side of a file log: append to your own origin only. No method writes a
/// foreign origin — that's the single-writer invariant. The caller supplies each
/// entry's index (the oplog assigns them; the file log follows).
/// A file log as a replica: multi-reader ([`LogSource`]), single-writer
/// ([`FileLogSink`]). The single-writer counterpart to
/// [`Replica`](super::Replica); owned by its mirror, not shared.
/// Anything that is both is a [`FileLogReplica`].