[−][src]Struct cueball::connection_pool::ConnectionPool
A pool of connections to a multi-node service
Implementations
impl<C, R, F> ConnectionPool<C, R, F> where
C: Connection,
R: Resolver,
F: FnMut(&Backend) -> C + Send + 'static,
[src]
C: Connection,
R: Resolver,
F: FnMut(&Backend) -> C + Send + 'static,
pub fn new(
cpo: ConnectionPoolOptions,
resolver: R,
create_connection: F
) -> Self
[src]
cpo: ConnectionPoolOptions,
resolver: R,
create_connection: F
) -> Self
pub fn stop(&mut self) -> Result<(), Error>
[src]
Stop the connection pool and resolver and close all connections in a graceful manner. This function may only be called on the original ConnectionPool instance. Thread JoinHandles may not be cloned and therefore invocation of this function by a clone of the pool results in an error. This function will block the caller until all claimed threads are returned to the pool and are closed and until all worker threads except for the thread running the resolver have exited.
pub fn claim(&self) -> Result<PoolConnection<C, R, F>, Error>
[src]
pub fn try_claim(&self) -> Option<PoolConnection<C, R, F>>
[src]
pub fn get_stats(&self) -> Option<ConnectionPoolStats>
[src]
pub fn get_state(&self) -> String
[src]
Trait Implementations
impl<C, R, F> Clone for ConnectionPool<C, R, F> where
C: Connection,
R: Resolver,
F: FnMut(&Backend) -> C + Send,
[src]
C: Connection,
R: Resolver,
F: FnMut(&Backend) -> C + Send,
fn clone(&self) -> ConnectionPool<C, R, F>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<C: Debug, R: Debug, F: Debug> Debug for ConnectionPool<C, R, F> where
C: Connection,
R: Resolver,
F: FnMut(&Backend) -> C + Send,
[src]
C: Connection,
R: Resolver,
F: FnMut(&Backend) -> C + Send,
impl<C, R, F> Drop for ConnectionPool<C, R, F> where
C: Connection,
R: Resolver,
F: FnMut(&Backend) -> C + Send,
[src]
C: Connection,
R: Resolver,
F: FnMut(&Backend) -> C + Send,
Auto Trait Implementations
impl<C, R, F> !RefUnwindSafe for ConnectionPool<C, R, F>
impl<C, R, F> Send for ConnectionPool<C, R, F>
impl<C, R, F> !Sync for ConnectionPool<C, R, F>
impl<C, R, F> Unpin for ConnectionPool<C, R, F> where
F: Unpin,
R: Unpin,
F: Unpin,
R: Unpin,
impl<C, R, F> !UnwindSafe for ConnectionPool<C, R, F>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,