Lossless intermediate representation (IR) for network device configuration text.
This crate provides:
- a tree model (
Document,Node,LineNode,BlockNode) - a conservative parser (
parse_generic,parse_with_dialect) - a lossless renderer (
Document::render)
The parser is intentionally conservative for pre-alpha use:
- it only uses indentation as a structural cue
- unknown patterns are preserved as regular lines
- no input lines are dropped
Example
use parse_generic;
let input = "interface Ethernet1\n description uplink\n";
let doc = parse_generic;
assert_eq!;