[][src]Struct google_maps::TimeZoneRequest

pub struct TimeZoneRequest<'a> { /* fields omitted */ }

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.

Methods

impl<'a> Request<'a>[src]

pub fn build(&mut self) -> &'a mut Request[src]

Builds the query string for the Google Maps Time Zone API based on the input provided by the client.

Arguments:

This method accepts no arguments.

impl<'a> Request<'a>[src]

pub fn execute(&'a mut self) -> Result<Response, Error>[src]

Executes the query you've built.

Description:

My adventures in Rust became messy so I had to make this method. It wraps the .validate()?.build()?.get()? chain needed at the end of the builder pattern.

Arguments:

This method accepts no arguments.

impl<'a> Request<'a>[src]

pub fn get(&mut self) -> Result<Response, Error>[src]

Performs the HTTP get request and returns the response to the caller.

Arguments:

This method accepts no arguments.

impl<'a> Request<'a>[src]

pub fn new(
    client_settings: &mut ClientSettings,
    location: LatLng,
    time: PrimitiveDateTime
) -> Request
[src]

Initializes the builder pattern for a Time Zone API query with the required, non-optional parameters.

Arguments:

  • key - Your application's Google Cloud API key.
  • location - Latitude & longitude of the desired time zone location.
  • time - Time is used to determine if Daylight Savings is applicable.

Example:

let time_zone = TimeZoneRequest::new(
    &mut my_settings,
    // St. Vitus Cathedral in Prague, Czechia
    LatLng::try_from(50.090_903, 14.400_512).unwrap(),
    PrimitiveDateTime::new(
        // Tuesday February 15, 2022
        Date::try_from_ymd(2022, 2, 15).unwrap(),
        // 6:00:00 pm
        Time::try_from_hms(18, 00, 0).unwrap(),
    ),
)

impl<'a> Request<'a>[src]

pub fn with_language(&'a mut self, language: Language) -> &'a mut Request[src]

Adds the language parameter to the Time Zone API query.

Arguments:

  • language ‧ The language that Google's response should be presented in.

Example:

  • Set Google's response to the French language:
.with_language(Language::French)

Trait Implementations

impl<'a> Debug for Request<'a>[src]

impl<'a> PartialEq<Request<'a>> for Request<'a>[src]

impl<'a> PartialOrd<Request<'a>> for Request<'a>[src]

impl<'a> StructuralPartialEq for Request<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for Request<'a>

impl<'a> Send for Request<'a>

impl<'a> Sync for Request<'a>

impl<'a> Unpin for Request<'a>

impl<'a> !UnwindSafe for Request<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,