#parser #rir #rsef

rsef-rs

A library for downloading and parsing RIR Statistics Exchange Format (RSEF) listings

5 releases

0.2.0 May 27, 2020
0.1.3 Feb 23, 2019
0.1.2 Feb 11, 2019
0.1.1 Feb 4, 2019
0.1.0 Feb 4, 2019

#1780 in Parser implementations

GPL-3.0 license

17KB
215 lines

RIR Statistics Exchange Format in Rust (rsef-rs)

Build Status codecov Crates

A library for downloading and parsing RIR Statistics Exchange Format (RSEF) listings in Rust.

Features

rsef-rs optionally includes the download feature which allows you to download listings from Regional Internet Registries with a single statement. In order to enable the download feature you can add the following to your dependencies section in your Cargo.toml:

[dependencies]
rsef-rs = { version = "0.2", features = ["download"] }

Examples & Documentation

Downloading and parsing an RSEF Listing

If you enabled the download feature, you can download listings as shown below:

use rsef_rs::{Registry, Line};

// Friday 1 February 2019 21:22:48
let timestamp = 1_549_056_168;
let stream = Registry::RIPE.download(timestamp).unwrap();
let records = rsef_rs::read_all(stream).unwrap();

for x in records {
    match x {
        Line::Version(x) => println!("Version: {:?}", x),
        Line::Summary(x) => println!("Summary: {:?}", x),
        Line::Record(x) => println!("Record: {:?}", x),
    }
}

For examples and documentation look here.

Dependencies

~0–4MB
~80K SLoC