#[non_exhaustive]pub struct PlaceView {
pub place: String,
pub place_id: String,
pub display_name: Option<LocalizedText>,
pub primary_type: String,
pub types: Vec<String>,
pub formatted_address: String,
pub postal_address: Option<PostalAddress>,
pub structure_type: StructureType,
pub location: Option<LatLng>,
pub display_polygon: Option<Struct>,
/* private fields */
}Expand description
Represents a view of a Place in the Places API. It also provides additional information specific to destinations, such as the structure type and the display polygon.
In some cases, a PlaceView with the same place ID might differ from what
is being returned by the Places API for the types and
display_name fields.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.place: StringThis Place’s resource name, in places/{placeId} format. Can be used to
look up the Place.
place_id: StringThe unique identifier of a place.
display_name: Option<LocalizedText>Human readable place description. For example, “Gate B”, “McDonalds”
primary_type: StringThe primary place type of this place. See https://developers.google.com/maps/documentation/places/web-service/place-types for the list of possible values.
Note: This field is not always populated. Be prepared to use the types
field in such situations.
types: Vec<String>All associated place types of this place. See https://developers.google.com/maps/documentation/places/web-service/place-types for the list of possible values.
formatted_address: StringOne line address.
postal_address: Option<PostalAddress>Structured address.
structure_type: StructureTypeThe type of structure corresponding to this place.
location: Option<LatLng>The location of this place. For places with display polygons, this can represent a good spot to put a marker on the map.
display_polygon: Option<Struct>The polygon outline of the place in GeoJSON format, using the RFC 7946 format: https://datatracker.ietf.org/doc/html/rfc7946#section-3.1.6.
Note: The RFC 7946 format supports MultiPolygons, so one display_polygon
object can represent multiple polygons.
Implementations§
Source§impl PlaceView
impl PlaceView
Sourcepub fn set_place_id<T: Into<String>>(self, v: T) -> Self
pub fn set_place_id<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_display_name<T>(self, v: T) -> Selfwhere
T: Into<LocalizedText>,
pub fn set_display_name<T>(self, v: T) -> Selfwhere
T: Into<LocalizedText>,
Sets the value of display_name.
§Example
use google_cloud_type::model::LocalizedText;
let x = PlaceView::new().set_display_name(LocalizedText::default()/* use setters */);Sourcepub fn set_or_clear_display_name<T>(self, v: Option<T>) -> Selfwhere
T: Into<LocalizedText>,
pub fn set_or_clear_display_name<T>(self, v: Option<T>) -> Selfwhere
T: Into<LocalizedText>,
Sets or clears the value of display_name.
§Example
use google_cloud_type::model::LocalizedText;
let x = PlaceView::new().set_or_clear_display_name(Some(LocalizedText::default()/* use setters */));
let x = PlaceView::new().set_or_clear_display_name(None::<LocalizedText>);Sourcepub fn set_primary_type<T: Into<String>>(self, v: T) -> Self
pub fn set_primary_type<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_formatted_address<T: Into<String>>(self, v: T) -> Self
pub fn set_formatted_address<T: Into<String>>(self, v: T) -> Self
Sets the value of formatted_address.
§Example
let x = PlaceView::new().set_formatted_address("example");Sourcepub fn set_postal_address<T>(self, v: T) -> Selfwhere
T: Into<PostalAddress>,
pub fn set_postal_address<T>(self, v: T) -> Selfwhere
T: Into<PostalAddress>,
Sets the value of postal_address.
§Example
use google_cloud_type::model::PostalAddress;
let x = PlaceView::new().set_postal_address(PostalAddress::default()/* use setters */);Sourcepub fn set_or_clear_postal_address<T>(self, v: Option<T>) -> Selfwhere
T: Into<PostalAddress>,
pub fn set_or_clear_postal_address<T>(self, v: Option<T>) -> Selfwhere
T: Into<PostalAddress>,
Sets or clears the value of postal_address.
§Example
use google_cloud_type::model::PostalAddress;
let x = PlaceView::new().set_or_clear_postal_address(Some(PostalAddress::default()/* use setters */));
let x = PlaceView::new().set_or_clear_postal_address(None::<PostalAddress>);Sourcepub fn set_structure_type<T: Into<StructureType>>(self, v: T) -> Self
pub fn set_structure_type<T: Into<StructureType>>(self, v: T) -> Self
Sets the value of structure_type.
§Example
use google_maps_geocode_v4::model::place_view::StructureType;
let x0 = PlaceView::new().set_structure_type(StructureType::Point);
let x1 = PlaceView::new().set_structure_type(StructureType::Section);
let x2 = PlaceView::new().set_structure_type(StructureType::Building);Sourcepub fn set_location<T>(self, v: T) -> Self
pub fn set_location<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_location<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_location<T>(self, v: Option<T>) -> Self
Sourcepub fn set_display_polygon<T>(self, v: T) -> Self
pub fn set_display_polygon<T>(self, v: T) -> Self
Sets the value of display_polygon.
§Example
use wkt::Struct;
let x = PlaceView::new().set_display_polygon(Struct::default()/* use setters */);Sourcepub fn set_or_clear_display_polygon<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_display_polygon<T>(self, v: Option<T>) -> Self
Sets or clears the value of display_polygon.
§Example
use wkt::Struct;
let x = PlaceView::new().set_or_clear_display_polygon(Some(Struct::default()/* use setters */));
let x = PlaceView::new().set_or_clear_display_polygon(None::<Struct>);