Struct forecast::ApiClient [−][src]
pub struct ApiClient<'a> { /* fields omitted */ }
The ApiClient is a thin wrapper around a reqwest::Client
which
sends requests to the Forecast and Time Machine APIs.
Methods
impl<'a> ApiClient<'a>
[src]
impl<'a> ApiClient<'a>
pub fn new(client: &'a Client) -> ApiClient<'a>
[src]
pub fn new(client: &'a Client) -> ApiClient<'a>
Construct a new ApiClient.
pub fn get_forecast<'b, T>(&self, request: T) -> ApiResult<Response> where
T: Borrow<ForecastRequest<'b>> + Sized,
[src]
pub fn get_forecast<'b, T>(&self, request: T) -> ApiResult<Response> where
T: Borrow<ForecastRequest<'b>> + Sized,
Send a Forecast API request, returns the corresponding Response.
Errors
This function is a thin wrapper around
reqwest::Client.get(..)
, so it will return an error under the
same conditions in which reqwest would.
pub fn get_time_machine<'b, T>(&self, request: T) -> ApiResult<Response> where
T: Borrow<TimeMachineRequest<'b>> + Sized,
[src]
pub fn get_time_machine<'b, T>(&self, request: T) -> ApiResult<Response> where
T: Borrow<TimeMachineRequest<'b>> + Sized,
Send a Time Machine API request, returns the corresponding Response.
Errors
This function is a thin wrapper around
reqwest::Client.get(..)
, so it will return an error under the
same conditions in which reqwest would.