pub struct IpGeolocationApi { /* private fields */ }Expand description
IP Geolocation package — 13 endpoints.
Implementations§
Source§impl IpGeolocationApi
impl IpGeolocationApi
pub fn new(http: HttpClient) -> Self
Sourcepub fn get(
&self,
ip: Option<&str>,
locality_language: &str,
) -> Result<IpGeolocationResponse>
pub fn get( &self, ip: Option<&str>, locality_language: &str, ) -> Result<IpGeolocationResponse>
Returns geolocation data for an IP address. Pass None to use the caller’s IP.
Sourcepub fn get_with_confidence_area(
&self,
ip: Option<&str>,
locality_language: &str,
) -> Result<IpGeolocationWithConfidenceAreaResponse>
pub fn get_with_confidence_area( &self, ip: Option<&str>, locality_language: &str, ) -> Result<IpGeolocationWithConfidenceAreaResponse>
Returns geolocation including confidence area polygon(s).
Sourcepub fn get_full(
&self,
ip: Option<&str>,
locality_language: &str,
) -> Result<IpGeolocationFullResponse>
pub fn get_full( &self, ip: Option<&str>, locality_language: &str, ) -> Result<IpGeolocationFullResponse>
Returns full geolocation including confidence area and hazard report.
Sourcepub fn get_country_by_ip(
&self,
ip: Option<&str>,
locality_language: &str,
) -> Result<CountryByIpResponse>
pub fn get_country_by_ip( &self, ip: Option<&str>, locality_language: &str, ) -> Result<CountryByIpResponse>
Returns country information for an IP address.
Sourcepub fn get_country_info(
&self,
country_code: &str,
locality_language: &str,
) -> Result<CountryInfo>
pub fn get_country_info( &self, country_code: &str, locality_language: &str, ) -> Result<CountryInfo>
Returns detailed information about a country by ISO code.
Sourcepub fn get_all_countries(
&self,
locality_language: &str,
) -> Result<Vec<CountryInfo>>
pub fn get_all_countries( &self, locality_language: &str, ) -> Result<Vec<CountryInfo>>
Returns a list of all countries with full details.
Sourcepub fn get_hazard_report(&self, ip: Option<&str>) -> Result<HazardReport>
pub fn get_hazard_report(&self, ip: Option<&str>) -> Result<HazardReport>
Returns a detailed hazard and threat report for an IP address.
Sourcepub fn get_user_risk(&self, ip: Option<&str>) -> Result<UserRisk>
pub fn get_user_risk(&self, ip: Option<&str>) -> Result<UserRisk>
Returns a risk assessment suitable for e-commerce and sign-up flows.
Sourcepub fn get_asn_info(
&self,
asn: &str,
locality_language: &str,
) -> Result<AsnInfoResponse>
pub fn get_asn_info( &self, asn: &str, locality_language: &str, ) -> Result<AsnInfoResponse>
Returns short ASN information (no peers/transit lists).
Sourcepub fn get_network_by_ip(
&self,
ip: &str,
locality_language: &str,
) -> Result<NetworkByIpResponse>
pub fn get_network_by_ip( &self, ip: &str, locality_language: &str, ) -> Result<NetworkByIpResponse>
Returns detailed network information for an IP address.
Sourcepub fn get_timezone_by_iana_id(
&self,
iana_time_zone_id: &str,
) -> Result<TimezoneResponse>
pub fn get_timezone_by_iana_id( &self, iana_time_zone_id: &str, ) -> Result<TimezoneResponse>
Returns timezone information for an IANA timezone ID (e.g. “Australia/Sydney”).
Sourcepub fn get_timezone_by_ip(&self, ip: Option<&str>) -> Result<TimezoneResponse>
pub fn get_timezone_by_ip(&self, ip: Option<&str>) -> Result<TimezoneResponse>
Returns timezone information for an IP address.
Sourcepub fn parse_user_agent(
&self,
user_agent_string: &str,
) -> Result<UserAgentResponse>
pub fn parse_user_agent( &self, user_agent_string: &str, ) -> Result<UserAgentResponse>
Parses a User-Agent string into device, OS and browser info.
Trait Implementations§
Source§impl Clone for IpGeolocationApi
impl Clone for IpGeolocationApi
Source§fn clone(&self) -> IpGeolocationApi
fn clone(&self) -> IpGeolocationApi
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more