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§
fn new_client() -> Self
Sourcefn new_without_connection_pooling() -> Self
fn new_without_connection_pooling() -> Self
Construct a client that does not reuse connections.
fn request( &self, req: Request<Bytes>, ) -> impl Future<Output = Result<Response<Bytes>, HttpError>> + MaybeSend
Provided Methods§
Sourcefn request_streamed(&self, req: Request<()>) -> (BodySender, ResponseFuture)where
Self: MaybeSend + 'static,
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".