tomlini
SAX TOML/INI parser and editor. Zero dependencies, three-tier (core/alloc/std).
Features
- 18× faster parse than
toml_edit(3.3 µs vs 59.5 µs for a 94-line Cargo.toml) - 2–3× faster edits with batch commit (single index build, descending sort, one-pass span fixup)
- No footguns — every API path preserves formatting unless explicitly overridden
- Three tiers:
core(zero alloc),alloc(full editing),std(error impls) - Serde bridge via
tomlini_serdefor struct deserialization
Quick start
let mut doc = parse?;
// Read
assert!;
let raw = doc.get.unwrap; // "8080"
let val = doc.get_decoded.unwrap; // "8080"
// Edit
doc.edit
.set
.insert
.with_above_comment
.commit?;
Feature flags
| Feature | What you get |
|---|---|
| (none) | parse_into() — span emitter, zero alloc |
alloc |
FlatDoc, parse(), full editing API |
std |
(default) std::error::Error impls |
License
MIT OR Apache-2.0