pub struct SnapshotState {
pub config: BookConfig,
pub next_seq: u64,
pub generations: Vec<u32>,
pub free_list_head: u32,
pub free_links: Vec<u32>,
pub levels: Vec<LevelState>,
pub live_orders: Vec<LiveOrderState>,
}Expand description
The complete structural state of a crate::Book, captured for
persistence by chronicle-wal (ARCHITECTURE.md section 10).
This is a plain data transfer shape: the byte format, its
validation, and its CRC live in chronicle-wal; the book only
captures and restores its own internals through it, so a restore
reproduces slot assignment, FIFO links, generations, and the
exact free list.
Fields§
§config: BookConfigThe configuration the book was built with.
next_seq: u64Sequence number the next accepted command will take.
generations: Vec<u32>Generation of every slot, free, live, and retired alike, in
slot order. Length is config.max_orders.
free_list_head: u32Head of the free list in allocation order, or NIL when no slot is free.
free_links: Vec<u32>Per-slot free list link, in slot order: for a free slot, the
next free slot in allocation order or NIL at the end of the
chain; NIL for live and retired slots. Length is
config.max_orders.
levels: Vec<LevelState>Per-level state in tick index order. Length is
config.grid_len.
live_orders: Vec<LiveOrderState>Every live order, in ascending slot order.