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
62
63
64
65
//! `mod_logfile`'s write budget, and the cursor tracking how much of it the
//! write in progress has spent.
/// mod_logfile's `snprintf` buffer size for UUID-prefixed lines.
/// Lines exceeding this in the formatted output lose their trailing newline,
/// causing the next queue entry to collide on the same physical line.
pub const MOD_LOGFILE_BUF_SIZE: usize = 2048;
/// Bytes one `snprintf` can put on disk: the buffer less its NUL.
///
/// A write that spends all of them lost the trailing newline it was still
/// owed, so the next write lands on the same physical line. An intact write
/// never reaches this — its newline is inside the budget — which is what makes
/// the boundary a decision rather than a guess.
pub const WRITE_LIMIT: usize = MOD_LOGFILE_BUF_SIZE - 1;
/// Forward tolerance on the boundary, in decoded-`String` space.
///
/// `String::from_utf8_lossy` replaces the 1..=3 bytes of a codepoint the cut
/// chopped with a 3-byte U+FFFD, so a successor sits at most this much later
/// than the byte count says, and never earlier. Anything further off — invalid
/// bytes at the cut, or a replacement earlier in the same write — falls outside
/// the window and is not split.
pub const DECODE_DRIFT: usize = 2;
/// Bytes the write in progress spent before the line now in hand.
///
/// `None` means its start was never seen, which switches the exact boundary off
/// rather than placing it somewhere assumed.
pub ;