Skip to main content

load_viewed_state

Function load_viewed_state 

Source
pub fn load_viewed_state(cache_dir: &Path) -> ViewedState
Expand description

Load the viewed-state ledger from cache_dir, returning an empty default when the file is missing, unreadable, or not valid JSON.

A missing ledger is the common first-run case, and a garbled one must never hard-error a render, so both collapse to the empty default rather than a caller-visible error. A version the reader does not understand is also treated as empty (forward-compat: a future writer’s shape never crashes an older render).