pub struct HttpClientConfig {
pub timeout: Duration,
pub user_agent: String,
pub proxy: Option<String>,
}Expand description
HTTP client configuration
Fields§
§timeout: DurationRequest timeout
user_agent: StringUser-Agent header
proxy: Option<String>Optional proxy URL (e.g., “http://user:pass@proxy:port”)
Implementations§
Source§impl HttpClientConfig
impl HttpClientConfig
Sourcepub fn with_timeout(self, timeout: Duration) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
Set request timeout
Sourcepub fn with_timeout_secs(self, secs: u64) -> Self
pub fn with_timeout_secs(self, secs: u64) -> Self
Set request timeout in seconds
Sourcepub fn with_user_agent(self, user_agent: impl Into<String>) -> Self
pub fn with_user_agent(self, user_agent: impl Into<String>) -> Self
Set User-Agent header
Sourcepub fn with_proxy(self, proxy: impl Into<String>) -> Self
pub fn with_proxy(self, proxy: impl Into<String>) -> Self
Set proxy URL
Sourcepub fn with_optional_proxy(self, proxy: Option<String>) -> Self
pub fn with_optional_proxy(self, proxy: Option<String>) -> Self
Set optional proxy URL
Trait Implementations§
Source§impl Clone for HttpClientConfig
impl Clone for HttpClientConfig
Source§fn clone(&self) -> HttpClientConfig
fn clone(&self) -> HttpClientConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HttpClientConfig
impl Debug for HttpClientConfig
Auto Trait Implementations§
impl Freeze for HttpClientConfig
impl RefUnwindSafe for HttpClientConfig
impl Send for HttpClientConfig
impl Sync for HttpClientConfig
impl Unpin for HttpClientConfig
impl UnwindSafe for HttpClientConfig
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