pub struct ClientBuilder { /* private fields */ }Expand description
Builder for configuring HTTP client
Implementations§
Source§impl ClientBuilder
impl ClientBuilder
Sourcepub fn default_header(
self,
name: impl AsRef<str>,
value: impl AsRef<str>,
) -> Result<Self>
pub fn default_header( self, name: impl AsRef<str>, value: impl AsRef<str>, ) -> Result<Self>
Add a default header for all requests
Sourcepub fn region(self, region: impl Into<String>) -> Self
pub fn region(self, region: impl Into<String>) -> Self
Set preferred region for regional routing
Sourcepub fn compression(self, enabled: bool) -> Self
pub fn compression(self, enabled: bool) -> Self
Enable automatic compression
Sourcepub fn max_redirects(self, max: usize) -> Self
pub fn max_redirects(self, max: usize) -> Self
Set maximum number of redirects to follow
Sourcepub fn pool_max_connections(self, max: usize) -> Self
pub fn pool_max_connections(self, max: usize) -> Self
Set connection pool max connections per host
Sourcepub fn pool_idle_timeout(self, timeout: Duration) -> Self
pub fn pool_idle_timeout(self, timeout: Duration) -> Self
Set connection pool idle timeout
Sourcepub fn pool_connection_timeout(self, timeout: Duration) -> Self
pub fn pool_connection_timeout(self, timeout: Duration) -> Self
Set connection pool connection timeout
Sourcepub fn pool_keep_alive(self, enabled: bool) -> Self
pub fn pool_keep_alive(self, enabled: bool) -> Self
Enable or disable connection keep-alive
Sourcepub fn on_request<F>(self, interceptor: F) -> Self
pub fn on_request<F>(self, interceptor: F) -> Self
Add a request interceptor
Sourcepub fn on_response<F>(self, interceptor: F) -> Self
pub fn on_response<F>(self, interceptor: F) -> Self
Add a response interceptor
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ClientBuilder
impl !RefUnwindSafe for ClientBuilder
impl Send for ClientBuilder
impl Sync for ClientBuilder
impl Unpin for ClientBuilder
impl !UnwindSafe for ClientBuilder
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