Expand description
The bundled reqwest HTTP transport for Rig.
ReqwestClient::default() is the process-wide client: built once on
first use and shared by every clone, so every provider client made with
it shares one connection pool. Construction never fails. When reqwest
cannot build its client (a host with no CA store, say), every send
reports that build failure in-band.
Native requests and bodies enter the captured Tokio context on each poll, using a lazy fallback when no runtime is current. Callers retain ownership; dropping an operation cancels local work, not accepted remote work. Hosts must keep their runtime driven with I/O and timers enabled until operations finish. Missing drivers can panic; a stopped runtime causes I/O failure.
use rig_reqwest::ReqwestClient;
let shared = ReqwestClient::default();
let custom = ReqwestClient::from(rig_reqwest::reqwest::Client::new());Re-exports§
pub use reqwest;
Structs§
- Reqwest
Client - A reqwest client implementing
HttpClientExt. - Reqwest
Middleware Client reqwest-middleware-native-tlsorreqwest-middleware-rustls - A configured middleware client implementing
HttpClientExt.
Functions§
- from_
reqwest - Wrap a reqwest transport error as
Error::Instance, retaining its source. - multipart_
form - Render a
MultipartFormas areqwest::multipart::Form. - shared
- The process-wide client, erased behind
DynHttpClient.