pub struct ClientBuilder { /* private fields */ }Expand description
A builder for creating instances of Client with custom configurations.
Allows customization of the connection pool parameters such as maximum connections, connection time-to-live (TTL), connection timeout, and acquisition timeout.
Implementations§
Source§impl Builder
impl Builder
Sourcepub fn pool_max_conns(self, max_conns: usize) -> Self
pub fn pool_max_conns(self, max_conns: usize) -> Self
Sourcepub fn pool_conn_ttl(self, ttl: Duration) -> Self
pub fn pool_conn_ttl(self, ttl: Duration) -> Self
Sourcepub fn pool_connect_timeout(self, timeout: Duration) -> Self
pub fn pool_connect_timeout(self, timeout: Duration) -> Self
Sourcepub fn pool_acquire_timeout(self, timeout: Duration) -> Self
pub fn pool_acquire_timeout(self, timeout: Duration) -> Self
Sourcepub fn build(self) -> Client
pub fn build(self) -> Client
Finalizes the builder and constructs the Client with the specified configuration.
This method takes the current configuration of the Builder instance, applies defaults
for any unspecified settings, and creates a new Client instance using these configurations.
Specifically, it initializes a new connection pool with the configured parameters and
associates this pool with the new Client.
§Returns
A Client instance configured according to the builder’s settings.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Builder
impl RefUnwindSafe for Builder
impl Send for Builder
impl Sync for Builder
impl Unpin for Builder
impl UnwindSafe for Builder
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