1 unstable release
Uses new Rust 2024
| 0.1.0 | Jun 5, 2026 |
|---|
#1848 in Configuration
190KB
4K
SLoC
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 = tomlini::parse("[server]\nport = 8080\n")?;
// Read
assert!(doc.has("server.port"));
let raw = doc.get("server.port").unwrap(); // "8080"
let val = doc.get_decoded("server.port").unwrap(); // "8080"
// Edit
doc.edit()
.set("server.port", "9090")
.insert("server", "host", "\"0.0.0.0\"")
.with_above_comment("Bind address")
.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