Skip to main content

HttpClientCapability

Trait HttpClientCapability 

Source
pub trait HttpClientCapability: Clone + Debug {
    // Required methods
    fn new_client() -> Self;
    fn new_without_connection_pooling() -> Self;
    fn request(
        &self,
        req: Request<Bytes>,
    ) -> impl Future<Output = Result<Response<Bytes>, HttpError>> + MaybeSend;

    // Provided method
    fn request_streamed(&self, req: Request<()>) -> (BodySender, ResponseFuture)
       where Self: MaybeSend + 'static { ... }
}

Required Methods§

Source

fn new_client() -> Self

Source

fn new_without_connection_pooling() -> Self

Construct a client that does not reuse connections.

Source

fn request( &self, req: Request<Bytes>, ) -> impl Future<Output = Result<Response<Bytes>, HttpError>> + MaybeSend

Provided Methods§

Source

fn request_streamed(&self, req: Request<()>) -> (BodySender, ResponseFuture)
where Self: MaybeSend + 'static,

Like Self::request, but the request body is provided incrementally, one chunk at a time, via the returned BodySender.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§