pub trait RequestHandler<'a> {
    const BASE_URL: &'static str;
    const API_KEY: Option<&'static str> = _;

    // Provided methods
    fn parameters<Function>(&self, function: Function) -> ParameterHashMap<'a>
       where Function: FnOnce(&mut ParameterHashMap<'a>) { ... }
    fn request<'async_trait, T>(
        request_builder: RequestBuilder
    ) -> Pin<Box<dyn Future<Output = Result<T, StatusCode>> + Send + 'async_trait>>
       where T: for<'de> Deserialize<'de> + 'async_trait { ... }
}
Expand description

A trait for handling HTTP requests.

Required Associated Constants§

source

const BASE_URL: &'static str

The base URL for the requests.

Provided Associated Constants§

source

const API_KEY: Option<&'static str> = _

The API key as string used for authentication.

Provided Methods§

source

fn parameters<Function>(&self, function: Function) -> ParameterHashMap<'a>where Function: FnOnce(&mut ParameterHashMap<'a>),

Builds the parameter hashmap using the given function.

source

fn request<'async_trait, T>( request_builder: RequestBuilder ) -> Pin<Box<dyn Future<Output = Result<T, StatusCode>> + Send + 'async_trait>>where T: for<'de> Deserialize<'de> + 'async_trait,

Sends an HTTP request with the given endpoint and parameters, and returns the parsed response.

Implementors§