pub trait HttpClientExt: WasmCompatSend + WasmCompatSync {
// Required methods
fn send<T, U>(
&self,
req: Request<T>,
) -> impl Future<Output = Result<Response<LazyBody<U>>>> + WasmCompatSend + 'static
where T: Into<Bytes> + WasmCompatSend,
U: From<Bytes> + WasmCompatSend + 'static;
fn send_multipart<U>(
&self,
req: Request<MultipartForm>,
) -> impl Future<Output = Result<Response<LazyBody<U>>>> + WasmCompatSend + 'static
where U: From<Bytes> + WasmCompatSend + 'static;
fn send_streaming<T>(
&self,
req: Request<T>,
) -> impl Future<Output = Result<StreamingResponse>> + WasmCompatSend
where T: Into<Bytes> + WasmCompatSend;
}Expand description
An HTTP client Rig sends through: unary, multipart and streaming requests.
rig-reqwest’s ReqwestClient is the bundled implementation; a provider
configuration takes any implementation with with_http(client).
Required Methods§
Sourcefn send<T, U>(
&self,
req: Request<T>,
) -> impl Future<Output = Result<Response<LazyBody<U>>>> + WasmCompatSend + 'static
fn send<T, U>( &self, req: Request<T>, ) -> impl Future<Output = Result<Response<LazyBody<U>>>> + WasmCompatSend + 'static
Sends a request and returns headers with a lazy body converted from bytes to U.
Sourcefn send_multipart<U>(
&self,
req: Request<MultipartForm>,
) -> impl Future<Output = Result<Response<LazyBody<U>>>> + WasmCompatSend + 'static
fn send_multipart<U>( &self, req: Request<MultipartForm>, ) -> impl Future<Output = Result<Response<LazyBody<U>>>> + WasmCompatSend + 'static
Sends a multipart request and returns headers with a lazy body converted to U.
Sourcefn send_streaming<T>(
&self,
req: Request<T>,
) -> impl Future<Output = Result<StreamingResponse>> + WasmCompatSend
fn send_streaming<T>( &self, req: Request<T>, ) -> impl Future<Output = Result<StreamingResponse>> + WasmCompatSend
Sends a request and returns headers with a stream of transport byte chunks.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl HttpClientExt for DynHttpClient
impl HttpClientExt for HttpErrorStreamingClient
Available on crate feature
test-utils only.impl HttpClientExt for MockStreamingClient
Available on crate feature
test-utils only.impl HttpClientExt for NonSuccessStreamingClient
Available on crate feature
test-utils only.impl HttpClientExt for RecordingHttpClient
Available on crate feature
test-utils only.impl HttpClientExt for SequencedHttpClient
Available on crate feature
test-utils only.impl HttpClientExt for SequencedStreamingHttpClient
Available on crate feature
test-utils only.