[][src]Struct google_maps::AddressComponent

pub struct AddressComponent {
    pub long_name: String,
    pub short_name: String,
    pub types: Vec<PlaceType>,
}

Contains the separate components applicable to this address.

Note the following facts about the address_components array:

  • The array of address components may contain more components than the formatted_address.

  • The array does not necessarily include all the political entities that contain an address, apart from those included in the formatted_address. To retrieve all the political entities that contain a specific address, you should use reverse geocoding, passing the latitude/longitude of the address as a parameter to the request.

  • The format of the response is not guaranteed to remain the same between requests. In particular, the number of address_components varies based on the address requested and can change over time for the same address. A component can change position in the array. The type of the component can change. A particular component may be missing in a later response.

To handle the array of components, you should parse the response and select appropriate values via expressions. See the guide to parsing a response.

Fields

long_name: String

The full text description or name of the address component as returned by the Geocoder.

short_name: String

An abbreviated textual name for the address component, if available. For example, an address component for the state of Alaska may have a long_name of "Alaska" and a short_name of "AK" using the 2-letter postal abbreviation.

types: Vec<PlaceType>

An array indicating the type of the address component. See the list of supported types.

Trait Implementations

impl Clone for AddressComponent[src]

impl Debug for AddressComponent[src]

impl<'de> Deserialize<'de> for AddressComponent[src]

impl Eq for AddressComponent[src]

impl Hash for AddressComponent[src]

impl Ord for AddressComponent[src]

impl PartialEq<AddressComponent> for AddressComponent[src]

impl PartialOrd<AddressComponent> for AddressComponent[src]

impl Serialize for AddressComponent[src]

impl StructuralEq for AddressComponent[src]

impl StructuralPartialEq for AddressComponent[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<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[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>,