Crates.io | rsef-rs |
lib.rs | rsef-rs |
version | 0.2.0 |
source | src |
created_at | 2019-02-04 13:38:53.486575 |
updated_at | 2020-05-27 11:06:11.539807 |
description | A library for downloading and parsing RIR Statistics Exchange Format (RSEF) listings. |
homepage | https://github.com/DevQps/rsef-rs |
repository | https://github.com/DevQps/rsef-rs |
max_upload_size | |
id | 112646 |
size | 49,651 |
A library for downloading and parsing RIR Statistics Exchange Format (RSEF) listings in Rust.
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"] }
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.