pub struct HttpClient { /* private fields */ }Expand description
Shared HTTP client with tuned connection-pool and proxy settings.
Wraps a reqwest::Client with sensible defaults for LLM provider use:
connection pooling enabled, limited idle connections per host, a
reasonable idle timeout, and optional proxy configuration. Designed to be
held as Arc<HttpClient> per provider or shared across providers.
Implementations§
Source§impl HttpClient
impl HttpClient
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new client with default pool settings and no proxy.
Defaults:
pool_max_idle_per_host: 10pool_idle_timeout: 90 seconds- proxy: none
Sourcepub fn pool_config(&self) -> (usize, Duration)
pub fn pool_config(&self) -> (usize, Duration)
Return the pool configuration as (max_idle_per_host, idle_timeout).
Sourcepub fn proxy_config(&self) -> &ProxyConfig
pub fn proxy_config(&self) -> &ProxyConfig
Return the resolved proxy configuration.
Trait Implementations§
Source§impl Debug for HttpClient
impl Debug for HttpClient
Auto Trait Implementations§
impl !RefUnwindSafe for HttpClient
impl !UnwindSafe for HttpClient
impl Freeze for HttpClient
impl Send for HttpClient
impl Sync for HttpClient
impl Unpin for HttpClient
impl UnsafeUnpin for HttpClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more