[−][src]Struct google_maps::Geocoding
When the geocoder returns results, it places them within a results array. Even if the geocoder returns no results (such as if the address doesn't exist) it still returns an empty results array.
Fields
address_components: Vec<AddressComponent>
Array containing the separate components applicable to this address.
formatted_address: String
A string containing the human-readable address of this location.
Often this address is equivalent to the postal address. Note that some countries, such as the United Kingdom, do not allow distribution of true postal addresses due to licensing restrictions.
The formatted address is logically composed of one or more address components. For example, the address "111 8th Avenue, New York, NY" consists of the following components: "111" (the street number), "8th Avenue" (the route), "New York" (the city) and "NY" (the US state).
Do not parse the formatted address programmatically. Instead you should use the individual address components, which the API response includes in addition to the formatted address field.
geometry: Geometry
Contains the geocoded latitude/longitude, recommended viewport for
displaying the returned result, the bounding box, and other additional
data. See the Geometry
struct declaration.
partial_match: Option<bool>
Indicates that the geocoder did not return an exact match for the original request, though it was able to match part of the requested address. You may wish to examine the original request for misspellings and/or an incomplete address.
Partial matches most often occur for street addresses that do not exist within the locality you pass in the request. Partial matches may also be returned when a request matches two or more locations in the same locality. For example, "21 Henr St, Bristol, UK" will return a partial match for both Henry Street and Henrietta Street. Note that if a request includes a misspelled address component, the geocoding service may suggest an alternative address. Suggestions triggered in this way will also be marked as a partial match.
place_id: String
A unique identifier that can be used with other Google APIs. For example, you can use the place_id in a Places API request to get details of a local business, such as phone number, opening hours, user reviews, and more. See the place ID overview.
plus_code: Option<PlusCode>
(See Open Location Code and plus codes) is an encoded location reference. Plus codes can be used as a replacement for street addresses in places where they do not exist (where buildings are not numbered or streets are not named.)
types: Vec<PlaceType>
Array indicates the type
of the returned result. This array contains a
set of zero or more tags identifying the type of feature returned in the
result. For example, a geocode of "Chicago" returns "locality" which
indicates that "Chicago" is a city, and also returns "political" which
indicates it is a political entity.
Methods
impl Geocoding
[src]
pub fn get_global_plus_code(&self) -> Option<String>
[src]
A helper function for destructuring the optional plus_code
field. If
the plus_code field is populated, this function will return the
global plus code. If the plus_code field is empty, this function
will return None
.
let plus_code = geocoding.get_global_plus_code();
pub fn get_compound_plus_code(&self) -> Option<String>
[src]
A helper function for destructuring the optional compound_code
field. If the compound_code field is populated, this function will
return the compound plus code. If the compound_code field is empty,
this function will return None
.
let compound_code = geocoding.get_compound_plus_code();
Trait Implementations
impl Clone for Geocoding
[src]
impl Debug for Geocoding
[src]
impl<'de> Deserialize<'de> for Geocoding
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl PartialEq<Geocoding> for Geocoding
[src]
impl PartialOrd<Geocoding> for Geocoding
[src]
fn partial_cmp(&self, other: &Geocoding) -> Option<Ordering>
[src]
fn lt(&self, other: &Geocoding) -> bool
[src]
fn le(&self, other: &Geocoding) -> bool
[src]
fn gt(&self, other: &Geocoding) -> bool
[src]
fn ge(&self, other: &Geocoding) -> bool
[src]
impl Serialize for Geocoding
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralPartialEq for Geocoding
[src]
Auto Trait Implementations
impl RefUnwindSafe for Geocoding
impl Send for Geocoding
impl Sync for Geocoding
impl Unpin for Geocoding
impl UnwindSafe for Geocoding
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,