load

Function load 

pub async fn load(path: &Path) -> Result<InMemorySession>
Expand description

Loads session state from a journal file by streaming it frame by frame.

Returns an empty session if the file is missing or empty. A file with a missing or unsupported header is renamed aside as a backup and an empty session is returned; a merely corrupt or truncated tail is instead trimmed to the last good frame boundary.

ยงErrors

Returns an I/O error if the file cannot be read, truncated, or backed up, or if a CRC-valid frame decodes to malformed ops: that is a decoding bug rather than on-disk corruption, so it is surfaced instead of silently discarded.