Skip to main content

WalTimeline

Struct WalTimeline 

Source
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

Source

pub fn segments(&self) -> &[WalSegment]

The salt segments of this WAL, in file order (one per salt epoch).

Source

pub fn commit_snapshots(&self) -> &[CommitSnapshot]

Every materializable CommitSnapshot across all segments, in commit order.

Source

pub fn residue(&self) -> &[WalResidue]

The stale WAL tails surfaced for forensics (not committed history).

Source

pub fn snapshot_at(&self, id: CommitId) -> Option<&CommitSnapshot>

Resolve a CommitId back to its CommitSnapshot.

Source

pub fn safety(&self) -> MaterializationSafety

The highest validation tier this WAL cleared (see MaterializationSafety).

Source

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.

Source

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.

Source

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.

Source

pub fn page_size(&self) -> u32

The page size (bytes) common to the base image and the WAL frames.

Source

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_seq is the COMMIT frame index; commit_seq is 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 via Self::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

Source§

fn clone(&self) -> WalTimeline

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for WalTimeline

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for WalTimeline

Source§

impl PartialEq for WalTimeline

Source§

fn eq(&self, other: &WalTimeline) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for WalTimeline

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.