elemental_core/http/mod.rs
1//! Reusable, config-swappable `reqwest::Client` configuration and distribution.
2//!
3//! [`SwappableClient`] distributes cloned `reqwest::Client` handles from a
4//! shared [`HttpClientConfig`]. Because `reqwest::Client` is internally
5//! reference-counted, swapping the configuration does not disrupt in-flight
6//! requests: requests that already acquired a client continue on the previous
7//! instance until completion, while subsequent requests receive the new client.
8
9mod client;
10mod config;
11mod request;
12#[cfg(test)]
13mod tests;
14
15pub use client::SwappableClient;
16pub use config::{
17 DEFAULT_CONNECT_TIMEOUT, DEFAULT_READ_TIMEOUT, DEFAULT_USER_AGENT, HttpClientConfig,
18 HttpClientError, Result,
19};
20pub use request::{HttpRequestError, RequestBuilderExt};