[go: up one dir, main page]

tokio 0.1.20

An event-driven, non-blocking I/O platform for writing asynchronous I/O backed applications.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use tokio_futures::compat;

/// Like `tokio::run`, but takes an `async` block
pub fn run_async<F>(future: F)
where
    F: std::future::Future<Output = ()> + Send + 'static,
{
    ::run(compat::infallible_into_01(future));
}

/// Like `tokio::spawn`, but takes an `async` block
pub fn spawn_async<F>(future: F)
where
    F: std::future::Future<Output = ()> + Send + 'static,
{
    ::spawn(compat::infallible_into_01(future));
}