Skip to main content

lex_trace/
replay.rs

1//! Replay: re-execute a function with effect-output overrides keyed by NodeId.
2
3use indexmap::IndexMap;
4
5#[derive(Debug, Clone)]
6pub struct Override {
7    pub node_id: String,
8    pub output: serde_json::Value,
9}
10
11/// Convert a list of overrides into the IndexMap shape the recorder uses.
12pub fn replay_with_overrides(overrides: &[Override]) -> IndexMap<String, serde_json::Value> {
13    let mut m = IndexMap::new();
14    for o in overrides {
15        m.insert(o.node_id.clone(), o.output.clone());
16    }
17    m
18}