Trait ConnectionManager

Source
pub trait ConnectionManager: Sync + Send {
    type Connection: Send;
    type Error: Error + Send;
    type CreateFut: Future<Output = Result<Self::Connection, Self::Error>> + Send;
    type ValidFut<'a>: Future<Output = bool> + Send
       where Self: 'a;

    // Required methods
    fn create_connection(&self) -> Self::CreateFut;
    fn is_valid<'a>(
        &'a self,
        connection: &'a Self::Connection,
    ) -> Self::ValidFut<'a>;
}

Required Associated Types§

Source

type Connection: Send

Source

type Error: Error + Send

Source

type CreateFut: Future<Output = Result<Self::Connection, Self::Error>> + Send

Source

type ValidFut<'a>: Future<Output = bool> + Send where Self: 'a

Required Methods§

Source

fn create_connection(&self) -> Self::CreateFut

Source

fn is_valid<'a>( &'a self, connection: &'a Self::Connection, ) -> Self::ValidFut<'a>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§