Trait diesel::r2d2::HandleEvent
source · pub trait HandleEvent: Debug + Sync + Send {
// Provided methods
fn handle_acquire(&self, event: AcquireEvent) { ... }
fn handle_release(&self, event: ReleaseEvent) { ... }
fn handle_checkout(&self, event: CheckoutEvent) { ... }
fn handle_timeout(&self, event: TimeoutEvent) { ... }
fn handle_checkin(&self, event: CheckinEvent) { ... }
}
Available on crate feature
r2d2
only.Expand description
A trait which is provided with information about events in a connection pool.
Provided Methods§
sourcefn handle_acquire(&self, event: AcquireEvent)
fn handle_acquire(&self, event: AcquireEvent)
Called when a new connection is acquired.
The default implementation does nothing.
sourcefn handle_release(&self, event: ReleaseEvent)
fn handle_release(&self, event: ReleaseEvent)
Called when a connection is released.
The default implementation does nothing.
sourcefn handle_checkout(&self, event: CheckoutEvent)
fn handle_checkout(&self, event: CheckoutEvent)
Called when a connection is checked out from the pool.
The default implementation does nothing.
sourcefn handle_timeout(&self, event: TimeoutEvent)
fn handle_timeout(&self, event: TimeoutEvent)
Called when a checkout attempt times out.
The default implementation does nothing.
sourcefn handle_checkin(&self, event: CheckinEvent)
fn handle_checkin(&self, event: CheckinEvent)
Called when a connection is checked back into the pool.