1use std::{io, ops::Deref, time::Duration};
2
3use compio_runtime::Runtime;
4use mod_use::mod_use;
5
6cfg_select! {
7 windows => {
8 mod_use![windows];
9 }
10 unix => {
11 mod_use![unix];
12 }
13 _ => {
14 compile_error!("Unsupported platform");
15 }
16}
17
18#[allow(async_fn_in_trait)]
20pub trait Adapter: Sized + Deref<Target = Runtime> {
21 fn new(runtime: Runtime) -> io::Result<Self>;
23
24 async fn wait(&self, timeout: Option<Duration>) -> io::Result<()>;
26
27 fn clear(&self) -> io::Result<()>;
29}