[−][src]Trait mpool::ManageConnection
A trait which provides connection-specific functionality.
Associated Types
type Connection: Send + 'static
The connection type this manager deals with.
Required methods
fn connect<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Self::Connection>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Self::Connection>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Attempts to create a new connection.
fn check<'life0, 'life1, 'async_trait>(
&'life0 self,
conn: &'life1 mut Self::Connection
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
&'life0 self,
conn: &'life1 mut Self::Connection
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Check if the connection is still valid, check background every check_interval
.
A standard implementation would check if a simple query like PING
succee,
if the Connection
is broken, error should return.