pub struct AddressValidation { /* private fields */ }Expand description
Implements a client for the Address Validation API.
§Example
async fn sample(
) -> anyhow::Result<()> {
let client = AddressValidation::builder().build().await?;
let response = client.validate_address()
/* set fields */
.send().await?;
println!("response {:?}", response);
Ok(())
}§Service Description
The service for validating addresses.
§Configuration
To configure AddressValidation 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://addressvalidation.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
AddressValidation holds a connection pool internally, it is advised to
create one and reuse it. You do not need to wrap AddressValidation in
an Rc or Arc to reuse it, because it
already uses an Arc internally.
Implementations§
Source§impl AddressValidation
impl AddressValidation
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Returns a builder for AddressValidation.
let client = AddressValidation::builder().build().await?;Sourcepub fn from_stub<T>(stub: impl Into<Arc<T>>) -> Selfwhere
T: AddressValidation + 'static,
pub fn from_stub<T>(stub: impl Into<Arc<T>>) -> Selfwhere
T: AddressValidation + '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 validate_address(&self) -> ValidateAddress
pub fn validate_address(&self) -> ValidateAddress
Validates an address.
§Example
use google_maps_addressvalidation_v1::Result;
async fn sample(
client: &AddressValidation
) -> Result<()> {
let response = client.validate_address()
/* set fields */
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn provide_validation_feedback(&self) -> ProvideValidationFeedback
pub fn provide_validation_feedback(&self) -> ProvideValidationFeedback
Feedback about the outcome of the sequence of validation attempts. This
should be the last call made after a sequence of validation calls for the
same address, and should be called once the transaction is concluded. This
should only be sent once for the sequence of ValidateAddress requests
needed to validate an address fully.
§Example
use google_maps_addressvalidation_v1::Result;
async fn sample(
client: &AddressValidation
) -> Result<()> {
let response = client.provide_validation_feedback()
/* set fields */
.send().await?;
println!("response {:?}", response);
Ok(())
}Trait Implementations§
Source§impl Clone for AddressValidation
impl Clone for AddressValidation
Source§fn clone(&self) -> AddressValidation
fn clone(&self) -> AddressValidation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more