Skip to main content

ConnectionPool

Trait ConnectionPool 

Source
pub trait ConnectionPool<D: Driver>: Debug {
    // Required methods
    fn get(
        &self,
    ) -> impl Future<Output = Result<impl AsRef<D::Connection> + AsMut<D::Connection>>> + Send;
    fn timeout_get(
        &self,
        timeout: Duration,
    ) -> impl Future<Output = Result<impl AsRef<D::Connection> + AsMut<D::Connection>>> + Send;
    fn detach(&self) -> impl Future<Output = Result<D::Connection>> + Send
       where Self: Sized;
    fn resize(&self, max_size: usize) -> Result<()>;
    fn close(self) -> impl Future<Output = Result<()>> + Send;
}

Required Methods§

Source

fn get( &self, ) -> impl Future<Output = Result<impl AsRef<D::Connection> + AsMut<D::Connection>>> + Send

Source

fn timeout_get( &self, timeout: Duration, ) -> impl Future<Output = Result<impl AsRef<D::Connection> + AsMut<D::Connection>>> + Send

Source

fn detach(&self) -> impl Future<Output = Result<D::Connection>> + Send
where Self: Sized,

Source

fn resize(&self, max_size: usize) -> Result<()>

Source

fn close(self) -> impl Future<Output = Result<()>> + Send

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<D: Driver> ConnectionPool<D> for Pool<DBConnectionManager<D>>
where <D as Driver>::Connection: Debug,

Source§

async fn get(&self) -> Result<impl AsRef<D::Connection> + AsMut<D::Connection>>

Source§

async fn timeout_get( &self, timeout: Duration, ) -> Result<impl AsRef<D::Connection> + AsMut<D::Connection>>

Source§

async fn detach(&self) -> Result<D::Connection>
where Self: Sized,

Source§

fn resize(&self, max_size: usize) -> Result<()>

Source§

fn close(self) -> impl Future<Output = Result<()>> + Send

Implementors§