diff options
author | David Kellum <dek-oss@gravitext.com> | 2020-02-26 10:38:54 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-26 10:38:54 -0800 |
commit | a4c4ac254b36c5b78038d416e3b78912df293f8f (patch) | |
tree | f2f542d05843320ee376c38c5dc71a473ace19df /tokio-macros | |
parent | 0589acc9ffb9175647d6b7a794edd8812f79399f (diff) |
docs: macros doc(cfg) workarounds (#2225)
This is a workaround for the fact that the doc(cfg) from outer cfg_*
macros doesn't get applied correctly. Its included in the rt-threaded
branch only, which is what is used for doc.rs via all-features.
Diffstat (limited to 'tokio-macros')
-rw-r--r-- | tokio-macros/src/lib.rs | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/tokio-macros/src/lib.rs b/tokio-macros/src/lib.rs index 19715113..bc8f203a 100644 --- a/tokio-macros/src/lib.rs +++ b/tokio-macros/src/lib.rs @@ -28,8 +28,9 @@ use proc_macro::TokenStream; /// /// ## Options: /// -/// - `core_threads=n` - Sets core threads to `n`. -/// - `max_threads=n` - Sets max threads to `n`. +/// +/// - `core_threads=n` - Sets core threads to `n` (requires `rt-threaded` feature). +/// - `max_threads=n` - Sets max threads to `n` (requires `rt-core` or `rt-threaded` feature). /// /// ## Function arguments: /// @@ -65,7 +66,7 @@ pub fn main_threaded(args: TokenStream, item: TokenStream) -> TokenStream { /// ## Options: /// /// - `basic_scheduler` - All tasks are executed on the current thread. -/// - `threaded_scheduler` - Uses the multi-threaded scheduler. Used by default. +/// - `threaded_scheduler` - Uses the multi-threaded scheduler. Used by default (requires `rt-threaded` feature). /// /// ## Function arguments: /// @@ -126,15 +127,15 @@ pub fn main_basic(args: TokenStream, item: TokenStream) -> TokenStream { /// /// ## Options: /// -/// - `basic_scheduler` - All tasks are executed on the current thread. Used by default. -/// - `threaded_scheduler` - Use multi-threaded scheduler. +/// - `core_threads=n` - Sets core threads to `n` (requires `rt-threaded` feature). +/// - `max_threads=n` - Sets max threads to `n` (requires `rt-core` or `rt-threaded` feature). /// /// ## Usage /// /// ### Select runtime /// /// ```no_run -/// #[tokio::test(threaded_scheduler)] +/// #[tokio::test(core_threads = 1)] /// async fn my_test() { /// assert!(true); /// } @@ -157,15 +158,15 @@ pub fn test_threaded(args: TokenStream, item: TokenStream) -> TokenStream { /// /// ## Options: /// -/// - `core_threads=n` - Sets core threads to `n`. -/// - `max_threads=n` - Sets max threads to `n`. +/// - `basic_scheduler` - All tasks are executed on the current thread. Used by default. +/// - `threaded_scheduler` - Use multi-threaded scheduler (requires `rt-threaded` feature). /// /// ## Usage /// /// ### Select runtime /// /// ```no_run -/// #[tokio::test(core_threads = 1)] +/// #[tokio::test(threaded_scheduler)] /// async fn my_test() { /// assert!(true); /// } |