1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
//! Shared [`reqwest::Client`] HTTP client. use std::sync::OnceLock; use std::time::Duration; static CLIENT: OnceLock<reqwest::Client> = OnceLock::new(); pub fn client() -> &'static reqwest::Client { CLIENT.get_or_init(|| { reqwest::Client::builder() .timeout(Duration::from_secs(30)) .build() .unwrap_or_default() }) }