pub async fn run<'a, T, E, U, F>(&self, f: F) -> Result<T, bb8::RunError<E>>
    where
        F: FnOnce(Connection) -> U + Send + 'a,
        U: Future<Output = Result<(Connection, T), E>> + Send + 'a,
        E: From<<RedisConnectionManager as bb8::ManageConnection>::Error> + Send + 'a,
        T: Send + 'a,
    {
        let f = move |conn: Option<Connection>| {
            let conn = conn.unwrap();
            f(conn).map(|res| match res {
                Ok((conn, item)) => Ok((item, Some(conn))),
                Err(err) => Err((err, None)),
            })
        };
        self.pool.run(f).await
    }
/// Run the function with a connection provided by the pool.
Run the function with a connection provided by the pool.
Run the function with a connection provided by the pool .
pub async fn run<'a, T, E, U, F>(&self, f: F) -> Result<T, bb8::RunError<E>>
    where
        F: FnOnce(Connection) -> U + Send + 'a,
        U: Future<Output = Result<(Connection, T), E>> + Send + 'a,
        E: From<<RedisConnectionManager as bb8::ManageConnection>::Error> + Send + 'a,
        T: Send + 'a,
    {
        let f = move |conn: Option<Connection>| {
            let conn = conn.unwrap();
            f(conn).map(|res| match res {
                Ok((conn, item)) => Ok((item, Some(conn))),
                Err(err) => Err((err, None)),
            })
        };
        self.pool.run(f).await
    }
pub async fn run < ' a , T , E , U , F > ( & self , f : F ) -> Result < T , bb8 :: RunError < E > > where F : FnOnce ( Connection ) -> U + Send + ' a , U : Future < Output = Result < ( Connection , T ) , E > > + Send + ' a , E : From < < RedisConnectionManager as bb8 :: ManageConnection > :: Error > + Send + ' a , T : Send + ' a , { let f = move | conn : Option < Connection > | { let conn = conn . unwrap ( ) ; f ( conn ) . map ( | res | match res { Ok ( ( conn , item ) ) => Ok ( ( item , Some ( conn ) ) ) , Err ( err ) => Err ( ( err , None ) ) , } ) } ; self . pool . run ( f ) . await }
Run the function with a connection provided by the pool.
Run the function with a connection provided by the pool .
&self
f
F
&self
f
F