pub struct Client { /* private fields */ }Expand description
Blocking client for the ip-api.io API.
let client = ip_api_io::blocking::Client::with_api_key("YOUR_API_KEY");
let info = client.lookup_ip("8.8.8.8")?;
println!("{:?}", info.location.country);Implementations§
Source§impl Client
impl Client
pub fn new() -> Self
pub fn with_api_key(key: impl Into<String>) -> Self
pub fn builder() -> ClientBuilder
pub fn lookup(&self) -> Result<IpInfo, Error>
pub fn lookup_ip(&self, ip: &str) -> Result<IpInfo, Error>
pub fn lookup_batch(&self, ips: &[&str]) -> Result<BatchIpLookupResponse, Error>
pub fn ip_reputation(&self, ip: &str) -> Result<Value, Error>
pub fn tor_check(&self, ip: &str) -> Result<TorDetection, Error>
pub fn asn(&self, ip: &str) -> Result<AsnLookup, Error>
pub fn email_info(&self, email: &str) -> Result<EmailInfo, Error>
pub fn validate_email( &self, email: &str, ) -> Result<AdvancedEmailValidation, Error>
pub fn validate_email_batch( &self, emails: &[&str], ) -> Result<BatchEmailValidationResponse, Error>
pub fn risk_score(&self) -> Result<RiskScore, Error>
pub fn risk_score_ip(&self, ip: &str) -> Result<RiskScore, Error>
pub fn email_risk_score(&self, email: &str) -> Result<RiskScore, Error>
pub fn whois(&self, domain: &str) -> Result<Whois, Error>
pub fn reverse_dns(&self, ip: &str) -> Result<ReverseDns, Error>
pub fn forward_dns(&self, hostname: &str) -> Result<ForwardDns, Error>
pub fn mx_records(&self, domain: &str) -> Result<MxLookup, Error>
pub fn domain_age(&self, domain: &str) -> Result<DomainAge, Error>
pub fn domain_age_batch( &self, domains: &[&str], ) -> Result<BatchDomainAgeResponse, Error>
pub fn rate_limit(&self) -> Result<RateLimitInfo, Error>
pub fn usage_summary(&self) -> Result<UsageSummary, Error>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Client
impl !UnwindSafe for Client
impl Freeze for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnsafeUnpin for Client
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more