pub struct ConnectionPool { /* private fields */ }Implementations§
Source§impl ConnectionPool
impl ConnectionPool
Sourcepub async fn spawn(
params: impl Into<String>,
count: usize,
) -> Result<Self, Error>
pub async fn spawn( params: impl Into<String>, count: usize, ) -> Result<Self, Error>
Spawns a new connection pool, given the address to the ClickHouse server, and the maximum number of connections that the pool can spawn.
§Errors
Returns an error if any of the connections failed to instantiate.
Sourcepub async fn acquire(&self) -> Result<ClientWrapper, Error>
pub async fn acquire(&self) -> Result<ClientWrapper, Error>
Acquires a Client from the pool.
Returns a ClientWrapper which will automatically return the client
to the pool when dropped.
§Errors
Returns an error if the semaphore is closed or no clients are available.
Trait Implementations§
Source§impl Clone for ConnectionPool
impl Clone for ConnectionPool
Auto Trait Implementations§
impl Freeze for ConnectionPool
impl !RefUnwindSafe for ConnectionPool
impl Send for ConnectionPool
impl Sync for ConnectionPool
impl Unpin for ConnectionPool
impl !UnwindSafe for ConnectionPool
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)