WHOIS Rust
This is a WHOIS client library for Rust, inspired by https://github.com/hjr265/node-whois
Usage
You can make a servers.json file or copy one from https://github.com/hjr265/node-whois
This is a simple example of servers.json.
Then, use the from_path (or from_string if your JSON data is in-memory) associated function to create a WhoIs instance.
extern crate whois_rust;
use WhoIs;
let whois = from_path.unwrap;
Use the lookup method and input a WhoIsLookupOptions instance to lookup a domain or an IP.
extern crate whois_rust;
use ;
let whois = from_path.unwrap;
let result: String = whois.lookup.unwrap;
Asynchronous APIs
You may want to use async APIs with your async runtime. This crate supports tokio, currently.
[]
= "*"
= ["tokio"]
After enabling the async feature, the from_path_async function and the lookup_async function are available.
Testing
Crates.io
https://crates.io/crates/whois-rust