Struct google_maps::AddressComponent
source · 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_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§
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§fn eq(&self, other: &AddressComponent) -> bool
fn eq(&self, other: &AddressComponent) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for AddressComponent
impl PartialOrd for AddressComponent
source§fn partial_cmp(&self, other: &AddressComponent) -> Option<Ordering>
fn partial_cmp(&self, other: &AddressComponent) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for AddressComponent
impl Serialize for AddressComponent
impl Eq for AddressComponent
impl StructuralPartialEq for AddressComponent
Auto Trait Implementations§
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
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.