[−][src]Struct forecast::ApiClient
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]
&'_ 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 async fn get_time_machine<'b, '_, T>(
&'_ self,
request: T
) -> ApiResult<Response> where
T: Borrow<TimeMachineRequest<'b>> + Sized,
[src]
&'_ 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.
Trait Implementations
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,