Client

Trait Client 

Source
pub trait Client {
    type ClientError: Error;

    // Required method
    fn execute<'life0, 'async_trait, R>(
        &'life0 self,
        request: R,
    ) -> Pin<Box<dyn Future<Output = Result<R::Response, Self::ClientError>> + Send + 'async_trait>>
       where R: 'async_trait + HttpRequest + Send,
             Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

A client that can execute http_request_derive::HttpRequests.

Required Associated Types§

Source

type ClientError: Error

An error that can be returned during request execution by the Client.

Required Methods§

Source

fn execute<'life0, 'async_trait, R>( &'life0 self, request: R, ) -> Pin<Box<dyn Future<Output = Result<R::Response, Self::ClientError>> + Send + 'async_trait>>
where R: 'async_trait + HttpRequest + Send, Self: 'async_trait, 'life0: 'async_trait,

Execute a http_request_derive::HttpRequest, and read the typed response.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§