Hyper: Clarify use of `#[tokio::main]`

Created on 27 Nov 2019  路  3Comments  路  Source: hyperium/hyper

The #[tokio::main] macro is used in most (all?) of the examples, and also shows up in documentation.

However, it's not a part of the hyper crate (and was explicitly removed from reexport https://github.com/hyperium/hyper/issues/1878).

I feel like this could be a confusing spot for people new to hyper/tokio, perhaps it would be good to mention pulling in tokio as a dependency for this feature more explicitly.

A-docs E-easy

Most helpful comment

Now the cargo dep should be:

tokio = { version = "0.2.3", features = ["macros"] }

All 3 comments

Now the cargo dep should be:

tokio = { version = "0.2.3", features = ["macros"] }

I've updated the examples README about dependencies required.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

seanmonstar picture seanmonstar  路  3Comments

gabisurita picture gabisurita  路  4Comments

toplinuxsir picture toplinuxsir  路  3Comments

nate-onesignal picture nate-onesignal  路  3Comments

klausi picture klausi  路  3Comments