ipwhois-rust 1.2.0

Official Rust client for the ipwhois.io IP Geolocation API. Simple, supports single and bulk IP lookups.
Documentation
//! # ipwhois
//!
//! Official, async Rust client for the [ipwhois.io](https://ipwhois.io) IP
//! Geolocation API.
//!
//! - ✅ Single and bulk IP lookups (IPv4 and IPv6)
//! - ✅ Works with both the **Free** and **Paid** plans
//! - ✅ HTTPS by default
//! - ✅ Localisation, field selection, threat detection, rate info
//! - ✅ Errors as values — every fallible call returns `Result<_, Error>`
//! - ✅ Uniform error categories (`api`, `network`, `invalid_argument`)
//!
//! ## Quick start
//!
//! ```no_run
//! use ipwhois::{IpWhois, Options};
//!
//! # async fn run() -> Result<(), ipwhois::Error> {
//! // Free plan (no API key, ~1 request/second per client IP)
//! let ipwhois = IpWhois::new();
//! let info = ipwhois.lookup("8.8.8.8").await?;
//!
//! // Paid plan (with API key, higher limits, bulk, security data, …)
//! let ipwhois = IpWhois::with_key("YOUR_API_KEY");
//! let info = ipwhois
//!     .lookup_with(
//!         "8.8.8.8",
//!         &Options::new().with_lang("en").with_security(true),
//!     )
//!     .await?;
//!
//! // Bulk lookup — up to 100 IPs in one call (paid only)
//! let list = ipwhois
//!     .bulk_lookup(["8.8.8.8", "1.1.1.1", "208.67.222.222"])
//!     .await?;
//!
//! // HTTPS is enabled by default. Call `.with_ssl(false)` to fall back to HTTP.
//! # Ok(()) }
//! ```
//!
//! ## Error handling
//!
//! Every fallible operation returns [`Result`]`<_, `[`Error`]`>`. The error
//! enum exposes three categories — `api`, `network`, `invalid_argument` —
//! and carries the relevant metadata (`http_status`, plus `retry_after` on
//! free-plan 429s).
//!
//! ```no_run
//! # use ipwhois::{IpWhois, Error};
//! # async fn run() {
//! let ipwhois = IpWhois::new();
//! match ipwhois.lookup("8.8.8.8").await {
//!     Ok(info) => println!("{} → {}", info.ip.unwrap_or_default(), info.country.unwrap_or_default()),
//!     Err(Error::Api { http_status: Some(429), retry_after, .. }) => {
//!         // Rate-limited — `retry_after` is set on the free plan only.
//!         eprintln!("rate-limited, retry in {:?}s", retry_after);
//!     }
//!     Err(e) => eprintln!("Lookup failed ({}): {}", e.error_type(), e.message()),
//! }
//! # }
//! ```

mod client;
mod error;
mod options;
mod response;

pub use client::{IpWhois, BULK_LIMIT, HOST_FREE, HOST_PAID, SUPPORTED_LANGUAGES, VERSION};
pub use error::Error;
pub use options::Options;
pub use response::{Connection, Currency, Flag, LookupResponse, Rate, Security, Timezone};