Struct 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§

Source§

impl Clone for IpData

Source§

fn clone(&self) -> IpData

Returns a duplicate of the value. Read more
1.0.0 · Source§

const fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for IpData

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for IpData

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for IpData

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl Freeze for IpData

§

impl RefUnwindSafe for IpData

§

impl Send for IpData

§

impl Sync for IpData

§

impl Unpin for IpData

§

impl UnwindSafe for IpData

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

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

fn in_current_span(self) -> Instrumented<Self>

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

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,