Struct google_maps::roads::nearest_roads::request::Request
source · pub struct Request<'a> { /* private fields */ }
Expand description
Look at this Request
struct for documentation on how to build your Snap
To Roads query. The methods implemented for this struct are what’s used
to build your request.
Implementations§
source§impl<'a> Request<'a>
impl<'a> Request<'a>
sourcepub async fn execute(
&'a mut self
) -> Result<NearestRoadsResponse, GoogleMapsError>
pub async fn execute( &'a mut self ) -> Result<NearestRoadsResponse, GoogleMapsError>
source§impl<'a> Request<'a>
impl<'a> Request<'a>
sourcepub async fn get(&mut self) -> Result<NearestRoadsResponse, GoogleMapsError>
pub async fn get(&mut self) -> Result<NearestRoadsResponse, GoogleMapsError>
Performs the HTTP get request and returns the response to the caller.
§Arguments
This method accepts no arguments.
source§impl<'a> Request<'a>
impl<'a> Request<'a>
sourcepub fn new(client: &GoogleMapsClient, points: Vec<LatLng>) -> Request<'_>
pub fn new(client: &GoogleMapsClient, points: Vec<LatLng>) -> Request<'_>
Initializes the builder pattern for a Nearest Roads query with the required parameters.
Note: The snapping algorithm works best for points that are not too far apart. If you observe odd snapping behavior, try creating paths that have points closer together. To ensure the best snap-to-road quality, you should aim to provide paths on which consecutive pairs of points are within 300m of each other. This will also help in handling any isolated, long jumps between consecutive points caused by GPS signal loss, or noise.
§Arguments
-
client
‧ Your application’s Google Maps API client struct. -
points
‧ The points to be snapped. The points parameter accepts a list of latitude/longitude pairs.
source§impl<'a> Request<'a>
impl<'a> Request<'a>
sourcepub fn query_url(&'a mut self) -> String
pub fn query_url(&'a mut self) -> String
Returns the URL query string that represents the query you’ve built.
§Description
Returns the query string that will be sent to the Google Maps API. It is the result of the builder pattern. This method could be useful for records or logging. It could also be used for passing to your HTTP client of choice and executing the HTTP GET request yourself.
§Arguments
This method accepts no arguments.