#[non_exhaustive]pub struct SearchDestinationsRequest {
pub travel_modes: Vec<TravelMode>,
pub language_code: String,
pub region_code: String,
pub primary_query: Option<PrimaryQuery>,
/* private fields */
}Expand description
Request message for DestinationService.SearchDestinations.
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.travel_modes: Vec<TravelMode>Optional. The travel modes to filter navigation points for. This influences
the navigation_points field returned in the response. If empty,
navigation points of all travel modes are returned.
language_code: StringOptional. Language in which the results should be returned.
region_code: StringOptional. Region code. The region code, specified as a ccTLD (“top-level domain”) two-character value. The parameter affects results based on applicable law. This parameter also influences, but not fully restricts, results from the service.
primary_query: Option<PrimaryQuery>Query for the primary destination. This can be either a place, a fully specified address, or a LatLng location. Some places and addresses with minimal information won’t be able to be turned into a destination.
The destinations are built around the specified primary query.
Note: only places and addresses that can have a navigational destination are supported. For example, a place that represents a house or an apartment complex can be used as the primary query, but places that represent a locality or an administrative area cannot be used as the primary query.
Implementations§
Source§impl SearchDestinationsRequest
impl SearchDestinationsRequest
Sourcepub fn set_travel_modes<T, V>(self, v: T) -> Self
pub fn set_travel_modes<T, V>(self, v: T) -> Self
Sets the value of travel_modes.
§Example
use google_maps_geocode_v4::model::navigation_point::TravelMode;
let x = SearchDestinationsRequest::new().set_travel_modes([
TravelMode::Drive,
TravelMode::Walk,
]);Sourcepub fn set_language_code<T: Into<String>>(self, v: T) -> Self
pub fn set_language_code<T: Into<String>>(self, v: T) -> Self
Sets the value of language_code.
§Example
let x = SearchDestinationsRequest::new().set_language_code("example");Sourcepub fn set_region_code<T: Into<String>>(self, v: T) -> Self
pub fn set_region_code<T: Into<String>>(self, v: T) -> Self
Sets the value of region_code.
§Example
let x = SearchDestinationsRequest::new().set_region_code("example");Sourcepub fn set_primary_query<T: Into<Option<PrimaryQuery>>>(self, v: T) -> Self
pub fn set_primary_query<T: Into<Option<PrimaryQuery>>>(self, v: T) -> Self
Sets the value of primary_query.
Note that all the setters affecting primary_query are mutually
exclusive.
§Example
use google_maps_geocode_v4::model::search_destinations_request::PrimaryQuery;
let x = SearchDestinationsRequest::new().set_primary_query(Some(PrimaryQuery::Place("example".to_string())));Sourcepub fn place(&self) -> Option<&String>
pub fn place(&self) -> Option<&String>
The value of primary_query
if it holds a Place, None if the field is not set or
holds a different branch.
Sourcepub fn set_place<T: Into<String>>(self, v: T) -> Self
pub fn set_place<T: Into<String>>(self, v: T) -> Self
Sets the value of primary_query
to hold a Place.
Note that all the setters affecting primary_query are
mutually exclusive.
§Example
let x = SearchDestinationsRequest::new().set_place("example");
assert!(x.place().is_some());
assert!(x.address_query().is_none());
assert!(x.location_query().is_none());Sourcepub fn address_query(&self) -> Option<&Box<AddressQuery>>
pub fn address_query(&self) -> Option<&Box<AddressQuery>>
The value of primary_query
if it holds a AddressQuery, None if the field is not set or
holds a different branch.
Sourcepub fn set_address_query<T: Into<Box<AddressQuery>>>(self, v: T) -> Self
pub fn set_address_query<T: Into<Box<AddressQuery>>>(self, v: T) -> Self
Sets the value of primary_query
to hold a AddressQuery.
Note that all the setters affecting primary_query are
mutually exclusive.
§Example
use google_maps_geocode_v4::model::search_destinations_request::AddressQuery;
let x = SearchDestinationsRequest::new().set_address_query(AddressQuery::default()/* use setters */);
assert!(x.address_query().is_some());
assert!(x.place().is_none());
assert!(x.location_query().is_none());Sourcepub fn location_query(&self) -> Option<&Box<LocationQuery>>
pub fn location_query(&self) -> Option<&Box<LocationQuery>>
The value of primary_query
if it holds a LocationQuery, None if the field is not set or
holds a different branch.
Sourcepub fn set_location_query<T: Into<Box<LocationQuery>>>(self, v: T) -> Self
pub fn set_location_query<T: Into<Box<LocationQuery>>>(self, v: T) -> Self
Sets the value of primary_query
to hold a LocationQuery.
Note that all the setters affecting primary_query are
mutually exclusive.
§Example
use google_maps_geocode_v4::model::search_destinations_request::LocationQuery;
let x = SearchDestinationsRequest::new().set_location_query(LocationQuery::default()/* use setters */);
assert!(x.location_query().is_some());
assert!(x.place().is_none());
assert!(x.address_query().is_none());Trait Implementations§
Source§impl Clone for SearchDestinationsRequest
impl Clone for SearchDestinationsRequest
Source§fn clone(&self) -> SearchDestinationsRequest
fn clone(&self) -> SearchDestinationsRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more