Struct ip_api::GeoIp [−][src]
pub struct GeoIp { /* fields omitted */ }
Information about an IP address.
Methods
impl GeoIp
[src]
impl GeoIp
pub fn new(host: Option<&str>, https: bool) -> Result<GeoIp, IpApiError>
[src]
pub fn new(host: Option<&str>, https: bool) -> Result<GeoIp, IpApiError>
Get information on an IP address or domain name. If no host is provided then it will return information on your current IP.
pub fn country(&self) -> Option<String>
[src]
pub fn country(&self) -> Option<String>
Get the country. (e.g. "United States")
pub fn country_code(&self) -> Option<String>
[src]
pub fn country_code(&self) -> Option<String>
Get the country code. (e.g. "US")
pub fn region(&self) -> Option<String>
[src]
pub fn region(&self) -> Option<String>
Get the region. (e.g. "CA" or "10")
pub fn region_name(&self) -> Option<String>
[src]
pub fn region_name(&self) -> Option<String>
Get the region name. (e.g. "California")
pub fn city(&self) -> Option<String>
[src]
pub fn city(&self) -> Option<String>
Get the city. (e.g. "Mountain View")
pub fn zip_code(&self) -> Option<String>
[src]
pub fn zip_code(&self) -> Option<String>
Get the zip code. (e.g. "94043")
pub fn location(&self) -> Option<(f32, f32)>
[src]
pub fn location(&self) -> Option<(f32, f32)>
Get the location as a tuple of latitude and longitude.
pub fn timezone(&self) -> Option<String>
[src]
pub fn timezone(&self) -> Option<String>
Get the timezone. (e.g. "America/Los_Angeles")
pub fn isp(&self) -> Option<String>
[src]
pub fn isp(&self) -> Option<String>
Get the internet service provider. (e.g. "Google")
pub fn organization(&self) -> Option<String>
[src]
pub fn organization(&self) -> Option<String>
Get the organization. (e.g. "Google")
pub fn as_nn(&self) -> Option<String>
[src]
pub fn as_nn(&self) -> Option<String>
Get the autonomous system number and name. (e.g. "AS15169 Google Inc.")
pub fn is_mobile(&self) -> bool
[src]
pub fn is_mobile(&self) -> bool
Get whether the IP is a cellular connection.
pub fn is_proxy(&self) -> bool
[src]
pub fn is_proxy(&self) -> bool
Get whether the IP is a known proxy.