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