Skip to main content

parse_line

Function parse_line 

Source
pub fn parse_line(line: &str) -> Result<ParsedLine, ParseError>
Expand description

Fully parse and validate a TSJSON line into a ParsedLine.

Performs all validations including:

  • Field count (exactly 8 tab-separated fields)
  • wall_ts_us is a valid i64
  • agent is non-empty and contains no whitespace
  • itc is non-empty
  • parents are valid blake3:<payload> hashes (or empty)
  • event_type is a known item.<verb>
  • item_id is a valid bones ID
  • data is valid JSON matching the event type schema
  • event_hash is blake3:<payload> and matches the recomputed hash

ยงErrors

Returns ParseError with a specific variant for each validation failure.