untokio 0.2.1

Automatically create tokio runtimes
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use tokio03 as tokio;

mod library {
    pub async fn read() -> Result<String, std::io::Error> {
        untokio::v03::spawn(async{
            tokio03::fs::read_to_string("Cargo.toml").await
        }).await.unwrap()
    }
}

fn main() {
    untokio::v03::set_runtime(tokio::runtime::Builder::new_multi_thread().enable_all().build().unwrap());
    untokio::v03::runtime().block_on(async {
        println!("{}", library::read().await.unwrap());
    });
}