Struct google_api_proto::google::maps::places::v1::autocomplete_places_response::suggestion::PlacePrediction
source · pub struct PlacePrediction {
pub place: String,
pub place_id: String,
pub text: Option<FormattableText>,
pub structured_format: Option<StructuredFormat>,
pub types: Vec<String>,
pub distance_meters: i32,
}
Expand description
Prediction results for a Place Autocomplete prediction.
Fields§
§place: String
The resource name of the suggested Place. This name can be used in other APIs that accept Place names.
place_id: String
The unique identifier of the suggested Place. This identifier can be used in other APIs that accept Place IDs.
text: Option<FormattableText>
Contains the human-readable name for the returned result. For establishment results, this is usually the business name and address.
text
is recommended for developers who wish to show a single UI
element. Developers who wish to show two separate, but related, UI
elements may want to use structured_format
instead. They are two
different ways to represent a Place prediction. Users should not try to
parse structured_format
into text
or vice versa.
This text may be different from the display_name
returned by
GetPlace.
May be in mixed languages if the request input
and language_code
are in different languages or if the Place does not have a translation
from the local language to language_code
.
structured_format: Option<StructuredFormat>
A breakdown of the Place prediction into main text containing the name of the Place and secondary text containing additional disambiguating features (such as a city or region).
structured_format
is recommended for developers who wish to show two
separate, but related, UI elements. Developers who wish to show a
single UI element may want to use text
instead. They are two
different ways to represent a Place prediction. Users should not try to
parse structured_format
into text
or vice versa.
types: Vec<String>
List of types that apply to this Place from Table A or Table B in https://developers.google.com/maps/documentation/places/web-service/place-types.
A type is a categorization of a Place. Places with shared types will share similar characteristics.
distance_meters: i32
The length of the geodesic in meters from origin
if origin
is
specified. Certain predictions such as routes may not populate this
field.
Trait Implementations§
source§impl Clone for PlacePrediction
impl Clone for PlacePrediction
source§fn clone(&self) -> PlacePrediction
fn clone(&self) -> PlacePrediction
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for PlacePrediction
impl Debug for PlacePrediction
source§impl Default for PlacePrediction
impl Default for PlacePrediction
source§impl Message for PlacePrediction
impl Message for PlacePrediction
source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moresource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.source§impl PartialEq for PlacePrediction
impl PartialEq for PlacePrediction
source§fn eq(&self, other: &PlacePrediction) -> bool
fn eq(&self, other: &PlacePrediction) -> bool
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for PlacePrediction
Auto Trait Implementations§
impl Freeze for PlacePrediction
impl RefUnwindSafe for PlacePrediction
impl Send for PlacePrediction
impl Sync for PlacePrediction
impl Unpin for PlacePrediction
impl UnwindSafe for PlacePrediction
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request