Skip to main content

Crate rig_reqwest

Crate rig_reqwest 

Source
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§

ReqwestClient
A reqwest client implementing HttpClientExt.
ReqwestMiddlewareClientreqwest-middleware-native-tls or reqwest-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 MultipartForm as a reqwest::multipart::Form.
shared
The process-wide client, erased behind DynHttpClient.