[][src]Struct cueball::connection_pool::ConnectionPool

pub struct ConnectionPool<C, R, F> where
    C: Connection,
    R: Resolver,
    F: FnMut(&Backend) -> C + Send + 'static, 
{ /* fields omitted */ }

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]

pub fn new(
    cpo: ConnectionPoolOptions,
    resolver: R,
    create_connection: F
) -> Self
[src]

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]

impl<C: Debug, R: Debug, F: Debug> Debug for ConnectionPool<C, R, F> where
    C: Connection,
    R: Resolver,
    F: FnMut(&Backend) -> C + Send
[src]

impl<C, R, F> Drop for ConnectionPool<C, R, F> where
    C: Connection,
    R: Resolver,
    F: FnMut(&Backend) -> C + Send
[src]

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

impl<C, R, F> !UnwindSafe for ConnectionPool<C, R, F>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,