Function load
pub(crate) async fn load(path: &Path) -> Result<InMemory>Available on crate feature
tokio only.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. A file in an older format is rewritten in the current one.
ยง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. It is returned as an error instead of being silently discarded.