Module journal

Source
Expand description

Version journaling and persistence for AIM files

This module provides functionality for managing journal files that track version history in AIM workflows. Journal files (.jnl) map version numbers to byte offsets in corresponding AIM files, enabling efficient random access to specific versions without parsing the entire file.

§Journal File Format

Journal files store entries in the format version,position with one entry per line:

1,0
2,150
3,320

§Workflow

  1. When an AIM file is modified, version headers are parsed to create journal entries
  2. Journal entries are saved to a corresponding .jnl file
  3. When reading specific versions, the journal is used to seek directly to the offset

§Examples

use std::path::Path;
use aimx::aim::{Journal, journal_file, journal_load};

let mut journals = Vec::new();
let path = Path::new("workflow.aim");

// Create or update journal file
journal_file(&mut journals, path)?;

// Load existing journal entries
journal_load(&mut journals, path)?;

Structs§

Journal
Represents a journal entry with version and file position.

Functions§

journal_file
Journals version headers in an .aim file and saves the journal entries to a .jnl file.
journal_load
Loads journal entries from a .jnl file.
journal_save
Saves the journal vector to a .jnl file for the corresponding .aim file.
to_journal_path
Converts an .aim file path to the corresponding .jnl file path.