pub struct PoolConfigBuilder { /* private fields */ }Expand description
Builder for PoolConfig.
Implementations§
Source§impl PoolConfigBuilder
impl PoolConfigBuilder
Sourcepub fn max_idle_per_host(self, max: usize) -> Self
pub fn max_idle_per_host(self, max: usize) -> Self
Sets the maximum idle connections per host.
Sourcepub fn unlimited_idle_per_host(self) -> Self
pub fn unlimited_idle_per_host(self) -> Self
Removes the limit on idle connections per host.
Sourcepub fn max_idle_total(self, max: usize) -> Self
pub fn max_idle_total(self, max: usize) -> Self
Sets the maximum total idle connections.
Sourcepub fn idle_timeout(self, timeout: Duration) -> Self
pub fn idle_timeout(self, timeout: Duration) -> Self
Sets the idle connection timeout.
Sourcepub fn tcp_keepalive(self, interval: Duration) -> Self
pub fn tcp_keepalive(self, interval: Duration) -> Self
Sets the TCP keepalive interval.
Sourcepub fn no_tcp_keepalive(self) -> Self
pub fn no_tcp_keepalive(self) -> Self
Disables TCP keepalive.
Sourcepub fn tcp_nodelay(self, enabled: bool) -> Self
pub fn tcp_nodelay(self, enabled: bool) -> Self
Sets whether to enable TCP nodelay.
Sourcepub fn max_response_size(self, size: usize) -> Self
pub fn max_response_size(self, size: usize) -> Self
Sets the maximum response body size in bytes.
§Security
This helps prevent memory exhaustion from extremely large responses.
Sourcepub fn build(self) -> PoolConfig
pub fn build(self) -> PoolConfig
Builds the pool configuration.
Trait Implementations§
Source§impl Clone for PoolConfigBuilder
impl Clone for PoolConfigBuilder
Source§fn clone(&self) -> PoolConfigBuilder
fn clone(&self) -> PoolConfigBuilder
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 PoolConfigBuilder
impl Debug for PoolConfigBuilder
Source§impl Default for PoolConfigBuilder
impl Default for PoolConfigBuilder
Source§fn default() -> PoolConfigBuilder
fn default() -> PoolConfigBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PoolConfigBuilder
impl RefUnwindSafe for PoolConfigBuilder
impl Send for PoolConfigBuilder
impl Sync for PoolConfigBuilder
impl Unpin for PoolConfigBuilder
impl UnwindSafe for PoolConfigBuilder
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