google_maps 3.9.5

An unofficial Google Maps Platform client library for the Rust programming language.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::address_validation::validate_address::RequestQuery;

// -----------------------------------------------------------------------------

impl crate::traits::RequestBody for crate::address_validation::validate_address::Request<'_> {
    /// Implementation of the `RequestBody` trait, which tells the `Client` how
    /// to convert the above defined `RequestBody` struct into JSON for
    /// submission to Google Maps.
    ///
    /// In this case, we'll be converting the `RequestQuery` struct into a JSON
    /// object which will be submitted inside the HTTP request's body.
    fn request_body(&self) -> Result<String, crate::Error> {
        Ok(serde_json::to_string(&RequestQuery::from(self))?)
    } // fn
} // impl