pub struct ConnectionManager<T: ClientFormat> { /* private fields */ }
Expand description
ConnectionManager
is the underlying manager that bb8::Pool
uses to manage connections.
Implementations§
Source§impl<T: ClientFormat> ConnectionManager<T>
impl<T: ClientFormat> ConnectionManager<T>
Sourcepub async fn try_new<A: Into<Destination>, S: Into<Settings>>(
destination: A,
options: ClientOptions,
settings: Option<S>,
span: Option<NonZeroU64>,
) -> Result<Self>
pub async fn try_new<A: Into<Destination>, S: Into<Settings>>( destination: A, options: ClientOptions, settings: Option<S>, span: Option<NonZeroU64>, ) -> Result<Self>
Creates a new connection manager for the pool.
This method builds a ConnectionManager
that the pool will use to create
and manage connections to ClickHouse
. Each connection will be built using
the provided destination, options, and settings.
§Arguments
destination
- TheClickHouse
server address (host:port or socket address)options
- Client configuration optionssettings
- OptionalClickHouse
settings to apply to all connectionsspan
- Optional tracing span ID for distributed tracing
§Errors
Returns an error if the destination cannot be resolved or is invalid
Sourcepub async fn try_new_with_builder(builder: ClientBuilder) -> Result<Self>
pub async fn try_new_with_builder(builder: ClientBuilder) -> Result<Self>
Creates a new connection manager from an existing ClientBuilder
.
This is an alternative constructor that allows you to pre-configure a
ClientBuilder
with custom settings before creating the connection manager.
This is useful when you need fine-grained control over the client configuration.
Unlike Self::try_new
, which creates a ClientBuilder
internally,
this method accepts a pre-configured builder directly.
§Errors
Returns an error if the builder’s destination cannot be verified
Sourcepub fn with_check(self, check: bool) -> Self
pub fn with_check(self, check: bool) -> Self
Whether the underlying connection will issue a ping
when checking health.
Sourcepub fn connection_identifier(&self) -> String
pub fn connection_identifier(&self) -> String
Useful to determine if 2 connections are essentially the same
Trait Implementations§
Source§impl<T: Clone + ClientFormat> Clone for ConnectionManager<T>
impl<T: Clone + ClientFormat> Clone for ConnectionManager<T>
Source§fn clone(&self) -> ConnectionManager<T>
fn clone(&self) -> ConnectionManager<T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more