Skip to main content

HttpClient

Trait HttpClient 

Source
pub trait HttpClient: Send + Sync {
    // Required method
    fn send<'life0, 'life1, 'async_trait>(
        &'life0 self,
        request: &'life1 RawRequest,
    ) -> Pin<Box<dyn Future<Output = Result<HttpResponse, LlmError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

HTTP client trait for sending requests.

Object-safe: &dyn HttpClient works. GenericProvider owns a concrete implementation and passes &dyn HttpClient to adapters via execute_stream.

Required Methods§

Source

fn send<'life0, 'life1, 'async_trait>( &'life0 self, request: &'life1 RawRequest, ) -> Pin<Box<dyn Future<Output = Result<HttpResponse, LlmError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Send an HTTP request and return the response.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§