Skip to main content

Crate Mem_Parser

Crate Mem_Parser 

Source
Expand description

Zero-copy semi-structured log parsing: streaming lines plus optional arena AST.

§mmap safety

See MappedFile.

Structs§

ArenaParser
Parses lines into bump-allocated ASTs. Combine with Bump::reset between lines for cheap rollback of speculative work.
BorrowedRecord
One parsed line with zero-copy field references into the source.
FieldNode
FieldRef
Zero-copy key/value or value-only field.
LineAst
AST for a single line; field slice memory is owned by the arena ('arena).
LineIter
Iterator over logical lines in buf, validated as UTF-8 per line.
LineView
One line of text with its starting byte offset in the parent buffer.
LogDialect
Configurable delimiters for semi-structured logs.
LogStream
Stream BorrowedRecord values from a contiguous byte buffer (UTF-8 validated per line).
MappedFile
Read-only mmap of an entire file, owning the memmap2::Mmap handle.
Span
Inclusive-exclusive byte span into UTF-8 source text [start, end).

Enums§

ParseError
Source
Convenience holder for contiguous input (mmap vs caller-owned/borrowed string).
SplitMode
How to split field tokens on a line.

Functions§

fields_on_line
Collect key/value or space-token fields from one line (heap Vec per call).
lines_in_str
Stream all lines from a UTF-8 &str (no per-line mmap cost beyond validation).
parse_log_stream
Convenience: stream from a guaranteed UTF-8 &str (same bytes as src.as_bytes()).
push_fields_on_line
Bump-friendly: push fields into out without extra allocation beyond out growth.