Mountain/ApplicationState/Internal/Persistence/MementoLoader.rs
1#![allow(non_snake_case)]
2
3//! # MementoLoader - Persistence layer
4//!
5//! Loads `ApplicationState` memento JSON from disk during boot.
6//! Two flavours: best-effort (returns empty on failure) and
7//! result-typed (surfaces failures explicitly during recovery).
8//!
9//! Layout (one export per file, file name = identity):
10//! - `LoadInitialMementoFromDisk::Fn` - best-effort loader for
11//! `ApplicationState::default()`. Backs up corrupted files, creates the
12//! parent directory on read errors.
13//! - `LoadMementoWithRecovery::Fn` - result-typed loader used during recovery
14//! flows; surfaces FS / parse failures.
15//! - `AttemptMementoRecovery::Fn` (internal) - write a `.backup` sibling for
16//! the corrupted content.
17//! - `CreateCorruptedBackup::Fn` (internal) - write a timestamped
18//! `.json.corrupted.<ts>` sibling.
19//!
20//! TODO: zero callers as of 2026-05-02 - pending wire-up from
21//! `Environment::StorageProvider` boot path.
22
23pub mod AttemptMementoRecovery;
24pub mod CreateCorruptedBackup;
25pub mod LoadInitialMementoFromDisk;
26pub mod LoadMementoWithRecovery;