pub struct ConnectionManager { /* private fields */ }Expand description
Connection manager for ClickHouse clients that implements BB8’s ManageConnection trait.
This manager handles creation, validation, and recycling of ClickHouse client connections.
It uses a ConnectionBuilder to configure new clients and periodically executes select 1;
to verify that clients are still valid.
Implementations§
Source§impl ConnectionManager
impl ConnectionManager
Sourcepub fn new(builder: ConnectionBuilder) -> Self
pub fn new(builder: ConnectionBuilder) -> Self
Creates a new ConnectionManager with the provided builder.
Trait Implementations§
Source§impl ManageConnection for ConnectionManager
impl ManageConnection for ConnectionManager
Source§fn connect<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Self::Connection, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn connect<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Self::Connection, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Creates a new connection.
Source§fn is_valid<'life0, 'life1, 'async_trait>(
&'life0 self,
conn: &'life1 mut Self::Connection,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn is_valid<'life0, 'life1, 'async_trait>(
&'life0 self,
conn: &'life1 mut Self::Connection,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Checks if a connection is still valid.
Source§fn has_broken(&self, conn: &mut Self::Connection) -> bool
fn has_broken(&self, conn: &mut Self::Connection) -> bool
Returns whether a connection is broken and should be recycled.
Source§type Connection = Connection
type Connection = Connection
The connection type this manager deals with.
Source§type Error = ClickHouseError
type Error = ClickHouseError
The error type returned by
Connections.Auto Trait Implementations§
impl Freeze for ConnectionManager
impl RefUnwindSafe for ConnectionManager
impl Send for ConnectionManager
impl Sync for ConnectionManager
impl Unpin for ConnectionManager
impl UnwindSafe for ConnectionManager
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