Module untokio::v02[][src]

tokio = “0.2spawn, runtime, try_set_runtime, set_runtime, handle

Example

mod library {
    use reqwest010 as reqwest; // relies on tokio 0.2

    pub async fn download() -> Result<String, reqwest::Error> {
        untokio::v02::spawn(async {
            reqwest::get("http://example.com/").await?.text().await
        }).await.unwrap()
    }
}

println!("{}", futures::executor::block_on(library::download()).unwrap());

Functions

current

Get a Handle for tokio - either the from tokio’s Handle::try_current or from untokio’s handle

handle

Get a Handle for untokio’s Runtime

runtime

Get untokio’s Runtime

set_runtime

Provide a Runtime instead of letting untokio create its own.

spawn

Spawns a new asynchronous task, returning a JoinHandle for it.

try_set_runtime

Provide a Runtime instead of letting untokio create its own.