pub struct WalTimeline { /* private fields */ }Expand description
The bespoke, format-exact temporal model of a -wal sidecar.
Enumerates the salt segments, the materializable CommitSnapshots within them
(CommitId-addressable), and the WalResidue tails. Materialize a snapshot’s page
images via CommitSnapshot::page_version; diff the acquired base against the last
valid commit via WalTimeline::diff_base_to_last_commit.
Implementations§
Source§impl WalTimeline
impl WalTimeline
Sourcepub fn segments(&self) -> &[WalSegment]
pub fn segments(&self) -> &[WalSegment]
The salt segments of this WAL, in file order (one per salt epoch).
Sourcepub fn commit_snapshots(&self) -> &[CommitSnapshot]
pub fn commit_snapshots(&self) -> &[CommitSnapshot]
Every materializable CommitSnapshot across all segments, in commit order.
Sourcepub fn residue(&self) -> &[WalResidue]
pub fn residue(&self) -> &[WalResidue]
The stale WAL tails surfaced for forensics (not committed history).
Sourcepub fn snapshot_at(&self, id: CommitId) -> Option<&CommitSnapshot>
pub fn snapshot_at(&self, id: CommitId) -> Option<&CommitSnapshot>
Resolve a CommitId back to its CommitSnapshot.
Sourcepub fn safety(&self) -> MaterializationSafety
pub fn safety(&self) -> MaterializationSafety
The highest validation tier this WAL cleared (see MaterializationSafety).
Sourcepub fn topology(&self) -> CohortTopology
pub fn topology(&self) -> CohortTopology
The temporal-cohort topology — LinearSegment for one salt epoch, else
Disconnected across checkpoint resets. The [H] adapter maps this onto
state-history-forensic::CohortTopology.
Sourcepub fn checksums_are_tamper_evident(&self) -> bool
pub fn checksums_are_tamper_evident(&self) -> bool
Whether the WAL’s integrity checks are tamper-EVIDENT. Always false: WAL
frame checksums are non-cryptographic (corruption detection, not tamper proof),
so the [H] adapter must record tamper_resistance = LOW.
Sourcepub fn diff_base_to_last_commit(&self) -> Option<WalDiff>
pub fn diff_base_to_last_commit(&self) -> Option<WalDiff>
Diff the acquired base image against the last valid commit snapshot, returning
the page numbers whose bytes changed. None when there is no committed snapshot.
Sourcepub fn page_size(&self) -> u32
pub fn page_size(&self) -> u32
The page size (bytes) common to the base image and the WAL frames.
Sourcepub fn to_temporal_cohort(
&self,
artifact: ArtifactRef,
) -> TemporalCohort<CommitId>
pub fn to_temporal_cohort( &self, artifact: ArtifactRef, ) -> TemporalCohort<CommitId>
Map this WAL timeline onto the canonical forensicnomicon::history cohort
vocabulary — the [H] adapter (#43 / WS-F).
Each materializable CommitSnapshot becomes one TemporalState<CommitId>:
- ordering key — a salt-qualified
LsnKind::SqliteWalFrame(frame_seqis the COMMIT frame index;commit_seqis the 0-based commit ordinal within the salt segment). The(salt1, salt2)pair keeps the key meaningful across a checkpoint reset, which renumbers frames and rolls the salts. - clock + safety — the canonical SQLite-WAL profile, single-sourced from
forensicnomicon::history::profiles, so no consumer re-asserts the four classifications locally. - handle — the snapshot’s
CommitId; resolve it back viaSelf::snapshot_at.
The topology is uniformly SubJournalCommits: every state is a committed
transaction, and a checkpoint reset is visible as a salt change inside the
ordering key — there is no separate “disconnected” topology to special-case. The
cohort is PathStable (a -wal belongs to exactly one database path), so the
caller supplies the path identity via artifact.
Trait Implementations§
Source§impl Clone for WalTimeline
impl Clone for WalTimeline
Source§fn clone(&self) -> WalTimeline
fn clone(&self) -> WalTimeline
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more