#![allow(incomplete_features)]
#![feature(async_fn_in_trait)]
use std::future::Future;
pub mod buf;
#[cfg(all(target_os = "linux", feature = "tokio-uring"))]
pub use tokio_uring;
#[cfg(all(target_os = "linux", feature = "tokio-uring"))]
mod compat;
#[cfg(feature = "net")]
pub mod net;
pub mod io;
pub type BufResult<T, B> = (std::io::Result<T>, B);
pub fn spawn<T: Future + 'static>(task: T) -> tokio::task::JoinHandle<T::Output> {
tokio::task::spawn_local(task)
}
#[cfg(all(target_os = "linux", feature = "tokio-uring"))]
pub fn start<F: Future>(task: F) -> F::Output {
tokio_uring::start(task)
}
#[cfg(not(all(target_os = "linux", feature = "tokio-uring")))]
pub fn start<F: Future>(task: F) -> F::Output {
use tokio::task::LocalSet;
tokio::runtime::Builder::new_current_thread()
.enable_all()
.build()
.unwrap()
.block_on(async move {
let local = LocalSet::new();
local.run_until(task).await
})
}