Skip to main content

read_run_state

Function read_run_state 

Source
pub fn read_run_state(
    store: &dyn JournalStore,
    paths: &JournalPaths,
    run_id: &str,
) -> Result<Option<RunState>>
Expand description

Authoritatively rebuild a run’s RunState straight from its event log — the read-only path release verify reconciles from.

Unlike load_state this ignores the manifest.json fast-path and always reduces the authoritative journal.jsonl, so a manifest that lags the log by its last event (a crash between append and manifest write) cannot hide a just-published receipt from the reconcile. Unlike Journal::open it takes no lock and writes nothing — not even the manifest self-heal — so it is safe against a live run and leaves the journal byte-for-byte unchanged (the read-only guarantee verify promises).

Returns Ok(None) when the run has no journal.

§Errors

An invalid run_id (io::ErrorKind::InvalidInput), or any store/parse error from read_events (a corrupt or too-new event line).