PlaceResult

Struct PlaceResult 

Source
pub struct PlaceResult {
Show 14 fields pub address_components: Option<Vec<AddressComponent>>, pub adr_address: Option<String>, pub formatted_address: Option<String>, pub geometry: Option<PlaceGeometry>, pub icon: Option<String>, pub icon_background_color: Option<String>, pub icon_mask_base_uri: Option<String>, pub name: Option<String>, pub place_id: Option<String>, pub reference: Option<String>, pub types: Option<Vec<AddressType>>, pub url: Option<String>, pub utc_offset: Option<i32>, pub vicinity: Option<String>,
}
Expand description

Attributes describing a place https://developers.google.com/maps/documentation/places/web-service/details#Place

Fields§

§address_components: Option<Vec<AddressComponent>>§adr_address: Option<String>§formatted_address: Option<String>§geometry: Option<PlaceGeometry>§icon: Option<String>§icon_background_color: Option<String>§icon_mask_base_uri: Option<String>§name: Option<String>§place_id: Option<String>§reference: Option<String>§types: Option<Vec<AddressType>>§url: Option<String>§utc_offset: Option<i32>§vicinity: Option<String>

Implementations§

Source§

impl PlaceResult

Source

pub fn address_component( &self, address_type: &AddressType, ) -> Option<&AddressComponent>

Obtain address component based on AddressType

Source

pub fn street_number(&self) -> Option<&str>

Obtain street number from address_components

Source

pub fn route(&self) -> Option<&str>

Obtain route from address_components

Source

pub fn sublocality(&self) -> Option<&str>

Obtain sublocality from address_components

Source

pub fn postal_code(&self) -> Option<&str>

Obtain postal code from address_components

Source

pub fn city(&self) -> Option<&str>

Obtain city from address_components

Source

pub fn state(&self) -> Option<&str>

Obtain state from address_components

Source

pub fn country(&self) -> Option<&str>

Obtain country from address_components

Source

pub fn country_code(&self) -> Option<&str>

Obtain country code from address_components

Trait Implementations§

Source§

impl Debug for PlaceResult

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for PlaceResult

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

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