feat(rt): export hyper::rt::main attribute macro
Usage:
#[hyper::rt::main]
async fn main() {
// async stuff in here
}
This commit is contained in:
14
src/rt.rs
14
src/rt.rs
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user