2022-12-14 03:52:14 -06:00
|
|
|
// edition:2021
|
|
|
|
// check-pass
|
|
|
|
|
|
|
|
#![allow(incomplete_features)]
|
|
|
|
|
|
|
|
use std::future::Future;
|
|
|
|
pub trait Pool {
|
|
|
|
type Conn;
|
|
|
|
|
2023-09-26 15:20:25 -05:00
|
|
|
#[allow(async_fn_in_trait)]
|
2022-12-14 03:52:14 -06:00
|
|
|
async fn async_callback<'a, F: FnOnce(&'a Self::Conn) -> Fut, Fut: Future<Output = ()>>(
|
|
|
|
&'a self,
|
|
|
|
callback: F,
|
|
|
|
) -> ();
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct PoolImpl;
|
|
|
|
pub struct ConnImpl;
|
|
|
|
|
|
|
|
impl Pool for PoolImpl {
|
|
|
|
type Conn = ConnImpl;
|
|
|
|
|
|
|
|
async fn async_callback<'a, F: FnOnce(&'a Self::Conn) -> Fut, Fut: Future<Output = ()>>(
|
|
|
|
&'a self,
|
|
|
|
_callback: F,
|
|
|
|
) -> () {
|
|
|
|
todo!()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|