Skip to main content

apply_lines

Function apply_lines 

Source
fn apply_lines(state: &mut BlockState, lines: &[&str], live_now_ms: Option<u64>)
Expand description

Fold newly-appended transcript lines into state.

Pure w.r.t. I/O so it can be unit-tested against real transcript shapes without a FileStore. Called once per tick with only the lines appended since the previous call — never the whole file.

A recent file takes its line’s own timestamp. Without one it takes live_now_ms: the read time when these lines were just written, None when they are backlog read on first sight of the block (srv restarted, or the block predates the watcher), whose read time says nothing about when the edit happened. Such an edit is not recorded.