AsyncHttpClient

Trait AsyncHttpClient 

Source
pub trait AsyncHttpClient {
    type Error;

    // Required methods
    fn get<Q, R>(
        &self,
        path: &str,
        query: &Q,
    ) -> impl Future<Output = Result<R, Self::Error>> + Send
       where Q: Serialize,
             R: DeserializeOwned;
    fn post<B, R>(
        &self,
        path: &str,
        body: &B,
    ) -> impl Future<Output = Result<R, Self::Error>> + Send
       where B: Serialize,
             R: DeserializeOwned;
    fn put<B, R>(
        &self,
        path: &str,
        body: &B,
    ) -> impl Future<Output = Result<R, Self::Error>> + Send
       where B: Serialize,
             R: DeserializeOwned;
    fn delete<B, R>(
        &self,
        path: &str,
        body: &B,
    ) -> impl Future<Output = Result<R, Self::Error>> + Send
       where B: Serialize,
             R: DeserializeOwned;
}

Required Associated Types§

Required Methods§

Source

fn get<Q, R>( &self, path: &str, query: &Q, ) -> impl Future<Output = Result<R, Self::Error>> + Send

Source

fn post<B, R>( &self, path: &str, body: &B, ) -> impl Future<Output = Result<R, Self::Error>> + Send

Source

fn put<B, R>( &self, path: &str, body: &B, ) -> impl Future<Output = Result<R, Self::Error>> + Send

Source

fn delete<B, R>( &self, path: &str, body: &B, ) -> impl Future<Output = Result<R, Self::Error>> + Send

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§