-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Yuki Okushi <[email protected]>
- Loading branch information
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// edition:2021 | ||
// check-pass | ||
|
||
#![feature(async_fn_in_trait)] | ||
#![allow(incomplete_features)] | ||
|
||
use std::future::Future; | ||
pub trait Pool { | ||
type Conn; | ||
|
||
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() {} |