[][src]Trait conjure_http::client::AsyncClient

pub trait AsyncClient {
    type BinaryWriter;
    type BinaryBody;
    fn request<'a, T, U>(
        &'a self,
        method: Method,
        path: &'static str,
        path_params: PathParams,
        query_params: QueryParams,
        headers: HeaderMap,
        body: T,
        response_visitor: U
    ) -> Pin<Box<dyn Future<Output = Result<U::Output, Error>> + Send + 'a>>

Notable traits for Pin<P>

impl<P> Future for Pin<P> where
    P: Unpin + DerefMut,
    <P as Deref>::Target: Future
type Output = <<P as Deref>::Target as Future>::Output;

    where
        T: AsyncRequestBody<'a, Self::BinaryWriter> + Send + 'a,
        U: VisitResponse<Self::BinaryBody> + Send + 'a
; }

A trait implemented by async HTTP client implementations.

Associated Types

type BinaryWriter[src]

The client's binary request body writer type.

type BinaryBody[src]

The client's binary response body type.

Loading content...

Required methods

fn request<'a, T, U>(
    &'a self,
    method: Method,
    path: &'static str,
    path_params: PathParams,
    query_params: QueryParams,
    headers: HeaderMap,
    body: T,
    response_visitor: U
) -> Pin<Box<dyn Future<Output = Result<U::Output, Error>> + Send + 'a>>

Notable traits for Pin<P>

impl<P> Future for Pin<P> where
    P: Unpin + DerefMut,
    <P as Deref>::Target: Future
type Output = <<P as Deref>::Target as Future>::Output;
where
    T: AsyncRequestBody<'a, Self::BinaryWriter> + Send + 'a,
    U: VisitResponse<Self::BinaryBody> + Send + 'a, 
[src]

Makes an async HTTP request.

The client is responsible for assembling the request URI. It is provided with the path template, unencoded path parameters, unencoded query parameters, header parameters, and request body.

A response must only be returned if it has a 2xx status code. The client is responsible for handling all other status codes (for example, converting a 5xx response into a service error). The client is also responsible for decoding the response body if necessary.

Loading content...

Implementors

Loading content...