Rust Axum Extractor Email Verification Guide
Add real-time email verification and disposable-email blocking to Rust Axum Extractor with the VeriShield Edge API. The snippet below gates a signup and returns the canonical email identity.
Language
Rust 1.78
Ecosystem
Tokio / reqwest
Latency
< 85ms
Install
Shell
cargo add axum reqwest serde_jsonVerification code
Rust 1.78
async fn verify_email(email: &str) -> Result<bool, reqwest::Error> {
let client = reqwest::Client::new();
let report: serde_json::Value = client
.post("https://verishield-edge-api.p.rapidapi.com/v1/verify")
.header("X-RapidAPI-Key", std::env::var("RAPIDAPI_KEY").unwrap_or_default())
.json(&serde_json::json!({ "email": email }))
.send().await?
.json().await?;
Ok(report["fraud_risk"]["recommendation"] != "BLOCK")
}What this protects against
Disposable and temporary inboxes, Gmail dot-trick and plus-alias multi-accounting, high-entropy bot usernames, and freshly registered fraud domains. The API returns a 0-100 fraud score with an ALLOW, CHALLENGE_2FA or BLOCK recommendation.