Trait diesel::r2d2::R2D2Connection
source · [−]pub trait R2D2Connection: Connection {
fn ping(&mut self) -> QueryResult<()>;
fn is_broken(&mut self) -> bool { ... }
}
Expand description
A trait indicating a connection could be used inside a r2d2 pool
Required Methods
sourcefn ping(&mut self) -> QueryResult<()>
fn ping(&mut self) -> QueryResult<()>
Check if a connection is still valid
Provided Methods
sourcefn is_broken(&mut self) -> bool
fn is_broken(&mut self) -> bool
Checks if the connection is broken and should not be reused
This method should return only contain a fast non-blocking check if the connection is considered to be broken or not. See ManageConnection::has_broken for details.
The default implementation does not consider any connection as broken