pub struct ConnectionPoolBuilder<T: ClientFormat> { /* private fields */ }
Expand description
Helper to construct a bb8 connection pool
Implementations§
Source§impl<T: ClientFormat> ConnectionPoolBuilder<T>
impl<T: ClientFormat> ConnectionPoolBuilder<T>
Sourcepub fn new<A: Into<Destination>>(destination: A) -> Self
pub fn new<A: Into<Destination>>(destination: A) -> Self
Initialize by providing a destination. Use Self::configure_client
to configure the
underlying ClientBuilder
.
Sourcepub fn with_client_builder(client_builder: ClientBuilder) -> Self
pub fn with_client_builder(client_builder: ClientBuilder) -> Self
Initialize by providing a ClientBuilder
directly.
Sourcepub fn connection_identifier(&self) -> String
pub fn connection_identifier(&self) -> String
Get the underlying client builder’s unique identifier.
Sourcepub fn client_options(&self) -> &ClientOptions
pub fn client_options(&self) -> &ClientOptions
Get a reference to the current configured ClientOptions
Sourcepub fn client_settings(&self) -> Option<&Settings>
pub fn client_settings(&self) -> Option<&Settings>
Get a reference to the current configured Settings
Sourcepub fn with_check(self) -> Self
pub fn with_check(self) -> Self
Whether the underlying connection will issue a ping
when checking health.
Sourcepub fn configure_client<F>(self, f: F) -> Self
pub fn configure_client<F>(self, f: F) -> Self
Configure the underlying client through the ClientBuilder
.
Sourcepub fn configure_pool<F>(self, f: F) -> Self
pub fn configure_pool<F>(self, f: F) -> Self
Configure the underlying PoolBuilder
Sourcepub async fn build_manager(&self) -> Result<ConnectionManager<T>>
pub async fn build_manager(&self) -> Result<ConnectionManager<T>>
Builds a connection manager with the given configuration.
§Errors
Returns an error if the connection manager build fails, ie Destination
fails to verify.
Sourcepub async fn build(self) -> Result<ConnectionPool<T>>
pub async fn build(self) -> Result<ConnectionPool<T>>
Builds a connection pool with the given configuration.
§Errors
Returns an error if the connection manager build fails or the pool build fails, ie
Destination
fails to verify.