netform_ir 0.1.0

Lossless intermediate representation and parser for network configuration text
Documentation
  • Coverage
  • 43.33%
    26 out of 60 items documented1 out of 26 items with examples
  • Size
  • Source code size: 22.51 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 5.9 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 29s Average build duration of successful builds.
  • all releases: 27s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • cyberwitchery/netform
    2 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • hellerve

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 netform_ir::parse_generic;

let input = "interface Ethernet1\n  description uplink\n";
let doc = parse_generic(input);
assert_eq!(doc.render(), input);