Struct ip_api_client::IpData

source ·
pub struct IpData {
Show 23 fields pub continent: Option<String>, pub continent_code: Option<String>, pub country: Option<String>, pub country_code: Option<String>, pub region: Option<String>, pub region_name: Option<String>, pub city: Option<String>, pub district: Option<String>, pub zip: Option<String>, pub lat: Option<f32>, pub lon: Option<f32>, pub timezone: Option<String>, pub offset: Option<i32>, pub currency: Option<String>, pub isp: Option<String>, pub org: Option<String>, pub as_field: Option<String>, pub asname: Option<String>, pub reverse: Option<String>, pub mobile: Option<bool>, pub proxy: Option<bool>, pub hosting: Option<bool>, pub query: Option<String>,
}
Expand description

The data that will be received after the making a request

Example response

IpData {
    continent: Some("Oceania".to_string()),
    continent_code: Some("OC".to_string()),
    country: Some("Australia".to_string()),
    country_code: Some("AU".to_string()),
    region: Some("QLD".to_string()),
    region_name: Some("Queensland".to_string()),
    city: Some("South Brisbane".to_string()),
    district: Some("".to_string()),
    zip: Some("4101".to_string()),
    lat: Some(-27.4766),
    lon: Some(153.0166),
    timezone: Some("Australia/Brisbane".to_string()),
    offset: Some(36000),
    currency: Some("AUD".to_string()),
    isp: Some("Cloudflare, Inc".to_string()),
    org: Some("APNIC and Cloudflare DNS Resolver project".to_string()),
    as_field: Some("AS13335 Cloudflare, Inc.".to_string()),
    asname: Some("CLOUDFLARENET".to_string()),
    reverse: Some("one.one.one.one".to_string()),
    mobile: Some(false),
    proxy: Some(false),
    hosting: Some(true),
    query: Some("1.1.1.1".to_string()),
};

Fields

continent: Option<String>

Continent name

continent_code: Option<String>

Two-letter continent code

country: Option<String>

Country name

country_code: Option<String>

Two-letter country code ISO 3166-1 alpha-2

region: Option<String>

Region/state short code (FIPS or ISO)

region_name: Option<String>

Region/state

city: Option<String>

City

district: Option<String>

District (subdivision of city)

zip: Option<String>

Zip code

lat: Option<f32>

Latitude

lon: Option<f32>

Longitude

timezone: Option<String>

Timezone (tz)

offset: Option<i32>

Timezone UTC DST offset in seconds

currency: Option<String>

National currency

isp: Option<String>

ISP name

org: Option<String>

Organization name

as_field: Option<String>

AS number and organization, separated by space (RIR). Empty for IP blocks not being announced in BGP tables.

Notice

We use as_field instead of as (As stated in the ip-api.com API documentation) since it’s a strict keyword in rust, such as pub, impl or struct.

asname: Option<String>

AS name (RIR). Empty for IP blocks not being announced in BGP tables.

reverse: Option<String>

Reverse DNS of the IP (can delay response)

mobile: Option<bool>

Mobile (cellular) connection

proxy: Option<bool>

Proxy, VPN or Tor exit address

hosting: Option<bool>

Hosting, colocated or data center

query: Option<String>

IP/Domain used for the query

Trait Implementations

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more