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
// =============================================================================
// #######
// ### ### F: outbox_journal_state.rs
// ## ## ## ## P: AppCore-Runtime
// ## ##
// C: 2026/09/02 00:00:00 by dnettoRaw
// ## ## ## ## U: 2026/09/02 00:00:00 by dnettoRaw
// ########### S: 2.0.0
// =============================================================================
//! Compact operations emitted while scanning the durable outbox journal.
use crate::sync::outbox_format::HASH_BYTES;
use std::sync::Arc;
pub(super) enum JournalOperation {
Enqueue {
batch_id: Arc<str>,
ordinal: u64,
data_offset: u64,
data_digest: [u8; HASH_BYTES],
encoded_bytes: usize,
frame_bytes: u64,
},
Acknowledge {
count: usize,
},
Attempt {
attempts: u32,
next_ready_at_ms: u64,
frame_bytes: u64,
},
}
pub(super) struct ScanPending {
pub(super) batch_id: Arc<str>,
pub(super) attempts: u32,
}
impl ScanPending {
pub(super) fn new(batch_id: Arc<str>, attempts: u32) -> Self {
Self { batch_id, attempts }
}
}
pub(super) struct ScanResult {
pub(super) operations: Vec<JournalOperation>,
pub(super) scanned_bytes: u64,
pub(super) record_count: u64,
pub(super) chain_head: [u8; HASH_BYTES],
pub(super) recovered_tail: bool,
}