Skip to main content

Crate strop_trace

Crate strop_trace 

Source
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.
TraceOptions
TraceSession
Owning lifetime of a trace. Explicit finish reports errors; Drop still drains.

Enums§

ContentPolicy
EventKind
TraceError

Constants§

MAX_CAPTURE_BYTES
Hard upper bounds a capture may use. They exist so a runaway producer cannot fill the disk; start refuses 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.