Trait fast_pool::Manager

source ·
pub trait Manager {
    type Connection;
    type Error: for<'a> From<&'a str>;

    // Required methods
    async fn connect(&self) -> Result<Self::Connection, Self::Error>;
    async fn check(
        &self,
        conn: &mut Self::Connection
    ) -> Result<(), Self::Error>;
}
Expand description

Manager create Connection and check Connection

Required Associated Types§

source

type Connection

source

type Error: for<'a> From<&'a str>

Required Methods§

source

async fn connect(&self) -> Result<Self::Connection, Self::Error>

create Connection and check Connection

source

async fn check(&self, conn: &mut Self::Connection) -> Result<(), Self::Error>

check Connection is alive? if not return Error(Connection will be drop)

Object Safety§

This trait is not object safe.

Implementors§