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
//! Full validation over one captured reader snapshot.
use Path;
use crateResult;
use crateReader;
use ValidationReport;
/// Decode every complete block in the snapshot discovered by `Reader::open`.
///
/// # Snapshot
///
/// `Reader::open` captures the file extent before it walks the file and
/// retains the complete block list, and every read this pass makes is bounded
/// by that extent. A concurrent append therefore cannot enter this pass: bytes
/// written after the extent was measured are outside every read.
///
/// Replacement is a weaker guarantee than that, and deliberately so. The scan
/// opens the path a second time, so a file that is atomically replaced between
/// the open and the scan is read from the new inode under the old extent. That
/// is caught rather than believed: the new bytes fail the frame magic, the
/// frame CRCs, or the read itself, and the pass returns a structured error.
/// What it does not do is report on a file that no longer exists at that path.
/// A caller that needs replacement-proof validation should validate a file
/// handle it holds open, which this crate does not yet expose.
///
/// # Frame count
///
/// The report's frame count comes from the shared structural walk by way of
/// the reader snapshot, not from the block count. Deriving it here would
/// silently disagree with structural validation the moment a frame type that
/// is not a data frame becomes legal.
pub