Expand description
One opt-in diagnostic sink for all strop crates. Producers never perform file I/O or wait for the writer; an incomplete trace is always reported as such.
Capture is bounded (total bytes, total events, per-record bytes) and every
finished file ends with an explicit terminal TraceEnd marker, so a capped
or failed capture can never be mistaken for a complete one.
Modules§
- export
- Readers over a finished trace file: the privacy-preserving metadata export and the forensic node extractor. Both enforce the same physical contract the writer guarantees — schema, contiguous sequence, a single terminal marker — and never trust a truncated file.
- replay
- The forensic tape: one ordered record stream that makes a full-content trace replayable. The tape is owned by the UI thread and never cloned into workers; the diagnostic logger stays the only disk writer.
Structs§
- Limits
- Bounded capture: total bytes, total events, per-record bytes.
- Trace
Options - Trace
Session - Owning lifetime of a trace. Explicit finish reports errors; Drop still drains.
Enums§
Constants§
- MAX_
CAPTURE_ BYTES - Hard upper bounds a capture may use. They exist so a runaway producer
cannot fill the disk;
startrefuses anything outside them, and the reader applies the same totals, so writer and reader agree everywhere. - MAX_
CAPTURE_ EVENTS - MAX_
RECORD_ BYTES - SCHEMA_
VERSION - TERMINAL_
RESERVE - The writer always reserves this much of the byte budget for the terminal marker, so a capture that hits its cap still ends legibly.
Functions§
- capture_
content - enabled
- mark_
incomplete - End the capture visibly (used when a forensic value exceeds its cap mid-session): no further records are admitted and the terminal marker reports the capture incomplete instead of silently shrinking.
- preview
- UTF-8-safe bounded preview. The byte length and full text are separate fields.
- record
- record_
with - Lazy producer: no payload construction or allocation when disabled.
- start
- take_
failure - Report once to the editor’s status line; finish still returns the failure.