Mem_Parser 0.1.0

Zero-copy log parser with mmap input, streaming lines, and optional bump arena AST
Documentation

memory-safe-parser

Zero-copy parsing for semi-structured log-like text in Rust:

  • stream lines over &str/&[u8] or a memory-mapped file;
  • &str field views into the original line (no per-token heap strings);
  • optional bumpalo arena for a small per-line AST when you want structured pointers without a global allocator party.

Licensed under MIT OR Apache-2.0.

Crate name vs import name

Cargo dependency:

memory-safe-parser = "0.1"

Rust import:

use memory_safe_parser::{LogDialect, MappedFile};

Docs on docs.rs after the first publish.

Quickstart

Run the mmap example against bundled sample data:

cargo run --example mmap_stream

Parse an in-memory string without mmap:

use memory_safe_parser::{parse_log_stream, LogDialect};

let dialect = LogDialect::default();
for record in parse_log_stream("lvl=INFO msg=hello\n", dialect, None) {
    let record = record?;
    // record.line.text, record.fields[..]
}

Before publishing to crates.io

  1. Confirm the crate name is still free on crates.io.

  2. Replace authors / repository in Cargo.toml if your Git repo URL or contact details differ.

  3. Dry run:

    cargo publish --dry-run
    
  4. Publish:

    cargo publish
    

See also the mmap safety notes in the MappedFile documentation in source.