pub struct AddressComponent {
pub long_name: String,
pub short_name: String,
pub types: Vec<PlaceType>,
}Expand description
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_componentsvaries 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: StringThe full text description or name of the address component as returned by the Geocoder.
short_name: StringAn 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§
Source§impl Clone for AddressComponent
impl Clone for AddressComponent
Source§fn clone(&self) -> AddressComponent
fn clone(&self) -> AddressComponent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AddressComponent
impl Debug for AddressComponent
Source§impl<'de> Deserialize<'de> for AddressComponent
impl<'de> Deserialize<'de> for AddressComponent
Source§fn 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>,
Source§impl Hash for AddressComponent
impl Hash for AddressComponent
Source§impl Ord for AddressComponent
impl Ord for AddressComponent
Source§fn cmp(&self, other: &AddressComponent) -> Ordering
fn cmp(&self, other: &AddressComponent) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for AddressComponent
impl PartialEq for AddressComponent
Source§impl PartialOrd for AddressComponent
impl PartialOrd for AddressComponent
Source§impl Serialize for AddressComponent
impl Serialize for AddressComponent
impl Eq for AddressComponent
impl StructuralPartialEq for AddressComponent
Auto Trait Implementations§
impl Freeze for AddressComponent
impl RefUnwindSafe for AddressComponent
impl Send for AddressComponent
impl Sync for AddressComponent
impl Unpin for AddressComponent
impl UnwindSafe for AddressComponent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.