feat(rt): export hyper::rt::main attribute macro

Usage:

    #[hyper::rt::main]
    async fn main() {
        // async stuff in here
    }
This commit is contained in:
Sean McArthur
2019-07-10 14:12:21 -07:00
parent 8d4ae27b42
commit f0478c6267
2 changed files with 4 additions and 16 deletions

View File

@@ -11,6 +11,8 @@ pub use futures_core::Stream;
use tokio;
pub use tokio::main;
use self::inner::Spawn;
/// Spawns a future on the default executor.
@@ -34,18 +36,6 @@ where
}
}
/// Start the Tokio runtime using the supplied future to bootstrap execution.
///
/// # Example
///
/// See the [server documentation](::server) for an example of its usage.
pub fn run<F>(f: F)
where
F: Future<Output = ()> + Send + 'static
{
tokio::run(f);
}
// Make the `Spawn` type an unnameable, so we can add
// methods or trait impls to it later without a breaking change.
mod inner {