[][src]Trait l337::ManageConnection

pub trait ManageConnection: Send + Sync + 'static {
    type Connection: Send + 'static;
    type Error: Fail;
    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>; }

A trait which provides connection-specific functionality.

Associated Types

type Connection: Send + 'static

The connection type this manager deals with.

type Error: Fail

The error type returned by Connections.

Loading content...

Required methods

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, 

Attempts to create a new connection.

Note that boxing is used here since impl Trait is not yet supported within trait definitions.

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, 

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

Quick check to determine if the connection has broken

fn timed_out(&self) -> L337Error<Self::Error>

Produce an error representing a connection timeout.

Loading content...

Implementors

Loading content...