#[non_exhaustive]pub struct LookupResponse {Show 26 fields
pub success: bool,
pub ip: Option<String>,
pub ip_type: Option<String>,
pub continent: Option<String>,
pub continent_code: Option<String>,
pub country: Option<String>,
pub country_code: Option<String>,
pub region: Option<String>,
pub region_code: Option<String>,
pub city: Option<String>,
pub latitude: Option<f64>,
pub longitude: Option<f64>,
pub is_eu: Option<bool>,
pub postal: Option<String>,
pub calling_code: Option<String>,
pub capital: Option<String>,
pub borders: Option<String>,
pub flag: Option<Flag>,
pub connection: Option<Connection>,
pub timezone: Option<Timezone>,
pub currency: Option<Currency>,
pub security: Option<Security>,
pub rate: Option<Rate>,
pub message: Option<String>,
pub error_type: Option<String>,
pub extra: HashMap<String, Value>,
}Expand description
Successful lookup response, or a per-IP entry inside a bulk response.
In the bulk endpoint each array entry is a LookupResponse; entries with
success = false carry the message and error_type fields populated by
the API instead of the geolocation fields.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.success: booltrue for successful lookups; false for per-IP errors inside a
bulk response (e.g. “Invalid IP address”, “Reserved range”).
ip: Option<String>The IP address that was looked up. Echoed back by the API.
ip_type: Option<String>"IPv4" or "IPv6".
continent: Option<String>§continent_code: Option<String>§country: Option<String>§country_code: Option<String>§region: Option<String>§region_code: Option<String>§city: Option<String>§latitude: Option<f64>§longitude: Option<f64>§is_eu: Option<bool>§postal: Option<String>§calling_code: Option<String>§capital: Option<String>§borders: Option<String>Comma-separated list of bordering country codes (e.g. "CA,MX").
flag: Option<Flag>§connection: Option<Connection>§timezone: Option<Timezone>§currency: Option<Currency>§security: Option<Security>§rate: Option<Rate>§message: Option<String>Populated when success = false (per-IP error inside a bulk response).
error_type: Option<String>Populated alongside message when the API tags the error type.
extra: HashMap<String, Value>Forward-compatibility bucket for any fields not yet modelled by this crate. New API fields land here without requiring a release.
Trait Implementations§
Source§impl Clone for LookupResponse
impl Clone for LookupResponse
Source§fn clone(&self) -> LookupResponse
fn clone(&self) -> LookupResponse
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more