Trait r2d2::CustomizeConnection [] [src]

pub trait CustomizeConnection<C, E>: Debug + Send + Sync + 'static {
    fn on_acquire(&self, conn: &mut C) -> Result<(), E> { ... }
}

A trait which allows for customization of connections.

Provided Methods

fn on_acquire(&self, conn: &mut C) -> Result<(), E>

Called with connections immediately after they are returned from ManageConnection::connect.

The default implementation simply returns Ok(()).

Errors

If this method returns an error, the connection will be discarded.

Implementors