asnames 0.1.0

A library for simple Autonomous System (AS) names and country lookup
Documentation
  • Coverage
  • 16.67%
    1 out of 6 items documented1 out of 3 items with examples
  • Size
  • Source code size: 43.67 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.94 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 54s Average build duration of successful builds.
  • all releases: 54s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • bgpkit/asnames-rs
    2 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • digizeph

asnames-rs

Simple Autonomous System (AS) names and country lookup Rust library

Data source

Data definition

#[derive(Debug, Clone)]
pub struct AsName {
    pub asn: u32,
    pub name: String,
    pub country: String,
}

Usage

use std::collections::HashMap;
use asnames::{AsName, load_asnames};

let asnames: HashMap<u32, AsName> = load_asnames().unwrap();
assert_eq!(asnames.get(&3333).unwrap().name, "RIPE-NCC-AS Reseaux IP Europeens Network Coordination Centre (RIPE NCC)");
assert_eq!(asnames.get(&400644).unwrap().name, "BGPKIT-LLC");
assert_eq!(asnames.get(&400644).unwrap().country, "US");