Skip to main content

ConnectionPool

Trait ConnectionPool 

Source
pub trait ConnectionPool<D: Driver>: Debug {
    // Required methods
    fn get<'s>(&'s self) -> BoxFuture<'s, Result<PooledConnection<D>>>;
    fn timeout_get<'s>(
        &'s self,
        timeout: Duration,
    ) -> BoxFuture<'s, Result<PooledConnection<D>>>;
    fn detach<'s>(&'s self) -> BoxFuture<'s, Result<D::Connection>>;
    fn resize(&self, max_size: usize) -> Result<()>;
    fn into_box(self) -> Box<dyn ConnectionPool<D>>
       where D: 'static;
    fn close(self) -> BoxFuture<'static, Result<()>>;
}

Required Methods§

Source

fn get<'s>(&'s self) -> BoxFuture<'s, Result<PooledConnection<D>>>

Source

fn timeout_get<'s>( &'s self, timeout: Duration, ) -> BoxFuture<'s, Result<PooledConnection<D>>>

Source

fn detach<'s>(&'s self) -> BoxFuture<'s, Result<D::Connection>>

Source

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

Source

fn into_box(self) -> Box<dyn ConnectionPool<D>>
where D: 'static,

Source

fn close(self) -> BoxFuture<'static, Result<()>>

Dyn Compatibility§

This trait is 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§

fn get<'s>(&'s self) -> BoxFuture<'s, Result<PooledConnection<D>>>

Source§

fn timeout_get<'s>( &'s self, timeout: Duration, ) -> BoxFuture<'s, Result<PooledConnection<D>>>

Source§

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

Source§

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

Source§

fn into_box(self) -> Box<dyn ConnectionPool<D>>
where D: 'static,

Source§

fn close(self) -> BoxFuture<'static, Result<()>>

Implementors§