[][src]Struct forecast::ApiClient

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]

pub fn new(client: &'a Client) -> ApiClient<'a>[src]

Construct a new ApiClient.

pub async fn get_forecast<'b, '_, T>(
    &'_ self,
    request: T
) -> ApiResult<Response> where
    T: Borrow<ForecastRequest<'b>> + Sized
[src]

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 async fn get_time_machine<'b, '_, T>(
    &'_ self,
    request: T
) -> ApiResult<Response> where
    T: Borrow<TimeMachineRequest<'b>> + Sized
[src]

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.

Trait Implementations

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

Auto Trait Implementations

impl<'a> !RefUnwindSafe for ApiClient<'a>

impl<'a> Send for ApiClient<'a>

impl<'a> Sync for ApiClient<'a>

impl<'a> Unpin for ApiClient<'a>

impl<'a> !UnwindSafe for ApiClient<'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.