Skip to main content

bgpkit_parser/render/
mod.rs

1/*!
2Human-readable record rendering.
3
4The [`text`] module renders one [`MrtRecord`](crate::MrtRecord) as a layered, indented text
5block — a full-fidelity transcript of the record: BGP4MP session context,
6withdrawn and announced prefixes, every path attribute, and RFC 7606
7validation warnings. The format is designed around this crate's own models
8(reusing the leaf `Display` implementations), not around any external tool's
9output; it is *inspired by bgpdump's human-readable output*.
10
11The [`hex`] module encodes raw record bytes (as yielded by
12[`BgpkitParser::into_filtered_raw_record_iter`](crate::BgpkitParser::into_filtered_raw_record_iter))
13as single hex strings — the paste format for byte-level dissectors such as
14[wirescope](https://wirescope.labs.bgpkit.com).
15
16Rendering is a pure function of the record: no iterators, no I/O, no
17session state. RIB entries reference peers by their table index because the
18peer table lives in a separate, earlier record.
19
20# Example
21
22```
23use bgpkit_parser::render::text::format_record;
24use bgpkit_parser::BgpkitParser;
25
26let parser = BgpkitParser::new("tests/fixtures/ripe/rrc00/2000.01/updates.20000102.2014.gz").unwrap();
27for record in parser.into_record_iter() {
28    println!("{}", format_record(&record));
29}
30```
31*/
32
33pub mod hex;
34pub mod text;