Module read

Source
Expand description

Journaled workflow reading utilities

This module provides functions for reading specific versions of AIM files based on their journal entries. It enables efficient access to historical versions without parsing the entire file.

§Overview

The reading utilities work in conjunction with the journal system to:

  • Locate specific versions of AIM files using byte offsets
  • Read the latest version of a workflow
  • Read any specific version by its epoch number

These functions are designed to work with the Journal entries that map version numbers to byte positions in AIM files, enabling efficient random access to specific versions.

§Examples

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

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

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

// Read the latest version
let latest_content = read_latest(&mut journals, path)?;

// Read a specific version
let version_content = read_version(&mut journals, path, 2)?;

Functions§

read_latest
Reads the contents of the latest version section of an AIM file based on its journal entries.
read_version
Reads the contents of a specific version of an AIM file based on its journal entries.