Trait l337::ManageConnection [−][src]
pub trait ManageConnection: Send + Sync + 'static {
type Connection: Send + 'static;
type Error: Error + Send;
fn connect<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Self::Connection, L337Error<Self::Error>>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait;
fn is_valid<'life0, 'life1, 'async_trait>(
&'life0 self,
conn: &'life1 mut Self::Connection
) -> Pin<Box<dyn Future<Output = Result<(), L337Error<Self::Error>>> + Send + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn has_broken(&self, conn: &mut Self::Connection) -> bool;
fn timed_out(&self) -> L337Error<Self::Error>;
}
Expand description
A trait which provides connection-specific functionality.
Associated Types
type Connection: Send + 'static
type Connection: Send + 'static
The connection type this manager deals with.
Required methods
Attempts to create a new connection.
Note that boxing is used here since impl Trait is not yet supported within trait definitions.
Determines if the connection is still connected to the database.
Note that boxing is used here since impl Trait is not yet supported within trait definitions.
fn has_broken(&self, conn: &mut Self::Connection) -> bool
fn has_broken(&self, conn: &mut Self::Connection) -> bool
Quick check to determine if the connection has broken