whoizz 0.1.0

Tiny, dependency-light RFC 3912 whois client with best-effort field extraction
Documentation
use std::io;

/// Errors returned by whois lookups.
#[derive(Debug, thiserror::Error)]
pub enum WhoisError {
    /// The input domain was empty after trimming.
    #[error("empty domain")]
    EmptyDomain,

    /// The input domain has no parseable TLD — e.g. a single label
    /// with no dot.
    #[error("no TLD in domain: {0:?}")]
    NoTld(String),

    /// IANA did not return a `refer:` line for this query. The TLD or
    /// IP block is not registered in IANA's whois, or the server
    /// returned an empty/unexpected response.
    #[error("IANA returned no referral for: {0:?}")]
    NoReferral(String),

    /// DNS resolution failed for the referred whois server.
    #[error("could not resolve whois server: {0:?}")]
    NoAddress(String),

    /// An I/O error from the underlying TCP connection (timeout,
    /// connection refused, read error, ...).
    #[error("I/O error: {0}")]
    Io(#[from] io::Error),
}