Expand description
Zero-copy TSJSON line parser.
Parses TSJSON (tab-separated fields with JSON payload) event lines into
Event structs or partially-parsed PartialEvent records. Designed
for high-throughput scanning of event shard files.
§TSJSON Format (v1, 8-field)
wall_ts_us \t agent \t itc \t parents \t type \t item_id \t data \t event_hash- Comment lines start with
#and are returned asParsedLine::Comment. - Blank/whitespace-only lines are returned as
ParsedLine::Blank. - Data lines are split on exactly 7 tab characters (yielding 8 fields).
§Zero-copy
PartialEvent borrows &str slices from the input line wherever
possible. Full parse (parse_line) copies into owned Event only
after validation succeeds.
Structs§
- Event
Parser - Streaming event parser.
- Partial
Event - A partially-parsed event that borrows from the input line.
Enums§
- Parse
Error - Errors that can occur while parsing a TSJSON line.
- Parsed
Line - The result of parsing a single line from a TSJSON shard file.
- Partial
Parsed Line - The result of partially parsing a single line.
Constants§
- CURRENT_
VERSION - The current event log format version understood by this build of bones.
- FIELD_
COMMENT - The field comment line that follows the shard header.
- SHARD_
HEADER - The shard header line written at the top of every
.eventsfile.
Functions§
- detect_
version - Detect the event log format version from the first line of a shard file.
- parse_
line - Fully parse and validate a TSJSON line into a
ParsedLine. - parse_
line_ partial - Parse a TSJSON line into a
PartialParsedLinewithout deserializing the JSON payload or verifying the event hash. - parse_
lines - Parse multiple TSJSON lines, skipping comments and blanks.