use asn_db2::Ipv4Database; use std::fs::File; use std::io::BufReader; fn main() { let db = Ipv4Database::from_reader(BufReader::new(File::open("ip2asn-v4.tsv").unwrap())).unwrap(); let entry = db.lookup("1.1.1.1".parse().unwrap()).unwrap(); println!("{:#?}", entry); }