Struct geocoding::opencage::OpencageResponse
source · [−]pub struct OpencageResponse<T> where
T: Float, {
pub documentation: String,
pub licenses: Vec<HashMap<String, String>>,
pub rate: Option<HashMap<String, i32>>,
pub results: Vec<Results<T>>,
pub status: Status,
pub stay_informed: HashMap<String, String>,
pub thanks: String,
pub timestamp: Timestamp,
pub total_results: i32,
}
Expand description
The top-level full JSON response returned by a forward-geocoding request
See the documentation for more details
{
"documentation": "https://opencagedata.com/api",
"licenses": [
{
"name": "CC-BY-SA",
"url": "http://creativecommons.org/licenses/by-sa/3.0/"
},
{
"name": "ODbL",
"url": "http://opendatacommons.org/licenses/odbl/summary/"
}
],
"rate": {
"limit": 2500,
"remaining": 2499,
"reset": 1523318400
},
"results": [
{
"annotations": {
"DMS": {
"lat": "41° 24' 5.06412'' N",
"lng": "2° 7' 43.40064'' E"
},
"MGRS": "31TDF2717083684",
"Maidenhead": "JN11bj56ki",
"Mercator": {
"x": 236968.295,
"y": 5043465.71
},
"OSM": {
"edit_url": "https://www.openstreetmap.org/edit?way=355421084#map=17/41.40141/2.12872",
"url": "https://www.openstreetmap.org/?mlat=41.40141&mlon=2.12872#map=17/41.40141/2.12872"
},
"callingcode": 34,
"currency": {
"alternate_symbols": [
],
"decimal_mark": ",",
"html_entity": "€",
"iso_code": "EUR",
"iso_numeric": 978,
"name": "Euro",
"smallest_denomination": 1,
"subunit": "Cent",
"subunit_to_unit": 100,
"symbol": "€",
"symbol_first": 1,
"thousands_separator": "."
},
"flag": "🇪🇸",
"geohash": "sp3e82yhdvd7p5x1mbdv",
"qibla": 110.53,
"sun": {
"rise": {
"apparent": 1523251260,
"astronomical": 1523245440,
"civil": 1523249580,
"nautical": 1523247540
},
"set": {
"apparent": 1523298360,
"astronomical": 1523304180,
"civil": 1523300040,
"nautical": 1523302080
}
},
"timezone": {
"name": "Europe/Madrid",
"now_in_dst": 1,
"offset_sec": 7200,
"offset_string": 200,
"short_name": "CEST"
},
"what3words": {
"words": "chins.pictures.passes"
}
},
"bounds": {
"northeast": {
"lat": 41.4015815,
"lng": 2.128952
},
"southwest": {
"lat": 41.401227,
"lng": 2.1284918
}
},
"components": {
"ISO_3166-1_alpha-2": "ES",
"_type": "building",
"city": "Barcelona",
"city_district": "Sarrià - Sant Gervasi",
"country": "Spain",
"country_code": "es",
"county": "BCN",
"house_number": "68",
"political_union": "European Union",
"postcode": "08017",
"road": "Carrer de Calatrava",
"state": "Catalonia",
"suburb": "les Tres Torres"
},
"confidence": 10,
"formatted": "Carrer de Calatrava, 68, 08017 Barcelona, Spain",
"geometry": {
"lat": 41.4014067,
"lng": 2.1287224
}
}
],
"status": {
"code": 200,
"message": "OK"
},
"stay_informed": {
"blog": "https://blog.opencagedata.com",
"twitter": "https://twitter.com/opencagedata"
},
"thanks": "For using an OpenCage Data API",
"timestamp": {
"created_http": "Mon, 09 Apr 2018 12:33:01 GMT",
"created_unix": 1523277181
},
"total_results": 1
}
Fields
documentation: String
licenses: Vec<HashMap<String, String>>
rate: Option<HashMap<String, i32>>
results: Vec<Results<T>>
status: Status
stay_informed: HashMap<String, String>
thanks: String
timestamp: Timestamp
total_results: i32
Trait Implementations
sourceimpl<T: Debug> Debug for OpencageResponse<T> where
T: Float,
impl<T: Debug> Debug for OpencageResponse<T> where
T: Float,
sourceimpl<'de, T> Deserialize<'de> for OpencageResponse<T> where
T: Float,
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for OpencageResponse<T> where
T: Float,
T: Deserialize<'de>,
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl<T> RefUnwindSafe for OpencageResponse<T> where
T: RefUnwindSafe,
impl<T> Send for OpencageResponse<T> where
T: Send,
impl<T> Sync for OpencageResponse<T> where
T: Sync,
impl<T> Unpin for OpencageResponse<T> where
T: Unpin,
impl<T> UnwindSafe for OpencageResponse<T> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
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
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more