pub struct WebConfig {
pub timeout: Option<Duration>,
pub connect_timeout: Option<Duration>,
pub read_timeout: Option<Duration>,
pub default_headers: Option<HeaderMap>,
pub proxy: Option<Proxy>,
}Expand description
Reqwest client configuration.
Fields§
§timeout: Option<Duration>§connect_timeout: Option<Duration>§read_timeout: Option<Duration>§default_headers: Option<HeaderMap>§proxy: Option<Proxy>Implementations§
Source§impl WebConfig
impl WebConfig
Sourcepub fn with_timeout(self, timeout: Duration) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
Sets the per-request timeout.
Sourcepub fn with_connect_timeout(self, timeout: Duration) -> Self
pub fn with_connect_timeout(self, timeout: Duration) -> Self
Sets the connect timeout.
Sourcepub fn with_default_headers(self, headers: HeaderMap) -> Self
pub fn with_default_headers(self, headers: HeaderMap) -> Self
Sets default headers.
Sourcepub fn with_proxy(self, proxy: Proxy) -> Self
pub fn with_proxy(self, proxy: Proxy) -> Self
Sets the proxy.
Sourcepub fn with_proxy_url(self, proxy_url: &str) -> Result<Self, Error>
pub fn with_proxy_url(self, proxy_url: &str) -> Result<Self, Error>
Sets the HTTP proxy from a URL.
Sourcepub fn with_https_proxy_url(self, proxy_url: &str) -> Result<Self, Error>
pub fn with_https_proxy_url(self, proxy_url: &str) -> Result<Self, Error>
Sets the HTTPS proxy from a URL.
Sourcepub fn with_all_proxy_url(self, proxy_url: &str) -> Result<Self, Error>
pub fn with_all_proxy_url(self, proxy_url: &str) -> Result<Self, Error>
Sets the proxy for all schemes from a URL.
Sourcepub fn apply_to_builder(&self, builder: ClientBuilder) -> ClientBuilder
pub fn apply_to_builder(&self, builder: ClientBuilder) -> ClientBuilder
Applies this config to a reqwest::ClientBuilder.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for WebConfig
impl !RefUnwindSafe for WebConfig
impl Send for WebConfig
impl Sync for WebConfig
impl Unpin for WebConfig
impl !UnwindSafe for WebConfig
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