Struct google_maps::time_zone::request::Request
source · pub struct Request<'a> { /* private fields */ }
Expand description
Look at this Request
struct for documentation on how to build your Time
Zone API 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<TimeZoneResponse, GoogleMapsError>
pub async fn execute(&'a mut self) -> Result<TimeZoneResponse, GoogleMapsError>
source§impl<'a> Request<'a>
impl<'a> Request<'a>
sourcepub async fn get(&mut self) -> Result<TimeZoneResponse, GoogleMapsError>
pub async fn get(&mut self) -> Result<TimeZoneResponse, 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 const fn new(
client: &GoogleMapsClient,
location: LatLng,
timestamp: DateTime<Utc>
) -> Request<'_>
pub const fn new( client: &GoogleMapsClient, location: LatLng, timestamp: DateTime<Utc> ) -> Request<'_>
Initializes the builder pattern for a Time Zone API query with the required, non-optional parameters.
§Arguments
-
client
‧ Your application’s Google Maps API client struct. -
location
‧ Latitude & longitude of the desired time zone location. -
timestamp
‧ Time is used to determine if Daylight Savings is applicable.
§Example
use google_maps::prelude::TimeZoneRequest;
use google_maps::{LatLng, NaiveDate};
let time_zone = TimeZoneRequest::new(
&my_settings,
// St. Vitus Cathedral in Prague, Czechia
LatLng::try_from_dec(50.090_903, 14.400_512)?,
// Tuesday February 15, 2022 @ 6:00:00 pm
NaiveDate::from_ymd(2022, 2, 15).and_hms(18, 00, 0)
).execute();
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.