pata 0.0.1

A fast, lightweight, and evidence-driven email validation library for Rust
Documentation
/// Pata's policy conclusion for an address.
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
#[non_exhaustive]
pub enum Verdict {
    /// The address is malformed.
    Invalid,
    /// A decisive domain or recipient result says mail cannot be received.
    Undeliverable,
    /// Mail may be accepted, but material risk or ambiguity was observed.
    Risky,
    /// The requested checks found no decisive failure.
    Plausible,
    /// The requested checks were inconclusive or unavailable.
    Unknown,
}

/// The DNS mail-routing conclusion attached to a report.
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
#[non_exhaustive]
pub enum DomainStatus {
    /// Domain validation was not requested.
    NotChecked,
    /// Explicit MX records provide a mail route.
    MailExchanger,
    /// Address records provide an implicit RFC 5321 route.
    ImplicitMailExchanger,
    /// The domain explicitly declines email through Null MX.
    NullMx,
    /// The queried domain does not exist.
    NxDomain,
    /// The domain exists but has no mail route.
    NoMailRoute,
    /// DNS did not return a conclusive result.
    Unknown,
}

/// The latest bounded SMTP recipient observation.
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
#[non_exhaustive]
pub enum MailboxStatus {
    /// Mailbox observation was not requested or no route was available.
    NotChecked,
    /// The server accepted the recipient at observation time.
    Accepted,
    /// The server permanently rejected the recipient.
    Rejected,
    /// The server reported a disabled recipient.
    Disabled,
    /// The server reported a full mailbox.
    Full,
    /// A transient or policy response prevented a conclusion.
    Unknown,
}

/// The result category of one finding.
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
#[non_exhaustive]
pub enum Outcome {
    /// The check returned a favorable result.
    Pass,
    /// The check observed a material but non-decisive concern.
    Warning,
    /// The check returned a decisive failure.
    Fail,
    /// The check could not establish an outcome.
    Unknown,
}

/// How directly an observation supports a finding.
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[non_exhaustive]
pub enum Certainty {
    /// The finding follows directly from a standard or authoritative result.
    Conclusive,
    /// The finding is strongly supported but may depend on remote policy.
    Strong,
    /// The finding is a useful heuristic rather than direct proof.
    Indicative,
}