[][src]Struct google_maps::Geocoding

pub struct Geocoding {
    pub address_components: Vec<AddressComponent>,
    pub formatted_address: String,
    pub geometry: Geometry,
    pub partial_match: Option<bool>,
    pub place_id: String,
    pub plus_code: Option<PlusCode>,
    pub types: Vec<PlaceType>,
}

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]

impl PartialEq<Geocoding> for Geocoding[src]

impl PartialOrd<Geocoding> for Geocoding[src]

impl Serialize for Geocoding[src]

impl StructuralPartialEq for Geocoding[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,