Skip to main content

parse_lines

Function parse_lines 

Source
pub fn parse_lines(input: &str) -> Result<Vec<Event>, (usize, ParseError)>
Expand description

Parse multiple TSJSON lines, skipping comments and blanks.

Returns a Vec of successfully parsed events. Stops at the first error, except for unknown event types which are skipped with a tracing warning (forward-compatibility policy: new event types may be added without a format version bump).

If the first non-blank content line looks like a shard header (# bones event log v<N>), the version is checked via detect_version and an error is returned immediately if the file was written by a newer version of bones.

ยงErrors

Returns (line_number, ParseError) on the first malformed data line (excluding unknown event types, which are warned and skipped). Line numbers are 1-indexed.