pub struct DestinationService { /* private fields */ }Expand description
Implements a client for the Geocoding API.
§Example
async fn sample(
) -> anyhow::Result<()> {
let client = DestinationService::builder().build().await?;
let response = client.search_destinations()
/* set fields */
.send().await?;
println!("response {:?}", response);
Ok(())
}§Service Description
A service for retrieving destinations.
A destination provides hierarchical context about a place, which allows you to, for example, find apartment buildings within a larger apartment complex and vice versa. It also provides navigation points suitable for use cases such as ridesharing or delivery.
§Configuration
To configure DestinationService use the with_* methods in the type returned
by builder(). The default configuration should
work for most applications. Common configuration changes include
- with_endpoint(): by default this client uses the global default endpoint
(
https://geocoding-backend.googleapis.com). Applications using regional endpoints or running in restricted networks (e.g. a network configured with Private Google Access with VPC Service Controls) may want to override this default. - with_credentials(): by default this client uses Application Default Credentials. Applications using custom authentication may need to override this default.
§Pooling and Cloning
DestinationService holds a connection pool internally, it is advised to
create one and reuse it. You do not need to wrap DestinationService in
an Rc or Arc to reuse it, because it
already uses an Arc internally.
Implementations§
Source§impl DestinationService
impl DestinationService
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Returns a builder for DestinationService.
let client = DestinationService::builder().build().await?;Sourcepub fn from_stub<T>(stub: impl Into<Arc<T>>) -> Selfwhere
T: DestinationService + 'static,
pub fn from_stub<T>(stub: impl Into<Arc<T>>) -> Selfwhere
T: DestinationService + 'static,
Creates a new client from the provided stub.
The most common case for calling this function is in tests mocking the client’s behavior.
Sourcepub fn search_destinations(&self) -> SearchDestinations
pub fn search_destinations(&self) -> SearchDestinations
This method performs a destination lookup and returns a list of destinations.
§Example
use google_maps_geocode_v4::Result;
async fn sample(
client: &DestinationService
) -> Result<()> {
let response = client.search_destinations()
/* set fields */
.send().await?;
println!("response {:?}", response);
Ok(())
}Trait Implementations§
Source§impl Clone for DestinationService
impl Clone for DestinationService
Source§fn clone(&self) -> DestinationService
fn clone(&self) -> DestinationService
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more