pub trait R2D2Connection: Connection {
    // Required method
    fn ping(&mut self) -> QueryResult<()>;

    // Provided method
    fn is_broken(&mut self) -> bool { ... }
}
Expand description

A trait indicating a connection could be used inside a r2d2 pool

Required Methods§

source

fn ping(&mut self) -> QueryResult<()>

Check if a connection is still valid

Provided Methods§

source

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

Implementors§