pub trait HttpClient:
Send
+ Sync
+ 'static {
// Required method
fn execute<'life0, 'async_trait>(
&'life0 self,
request: HttpRequest,
) -> Pin<Box<dyn Future<Output = Result<HttpResponse, HttpError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Send a request, return a streaming response.
Contract:
HttpResponse::urlmust be the post-redirect URL — streamable-HTTP transports resolve relative endpoints against it.- The body must be surfaced as a stream, not buffered — SSE consumers pull chunks incrementally.
- Use
HttpError::Requestfor connect/transport failures,HttpError::Bodyfor errors that surface mid-stream.
Required Methods§
fn execute<'life0, 'async_trait>(
&'life0 self,
request: HttpRequest,
) -> Pin<Box<dyn Future<Output = Result<HttpResponse, HttpError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".