diff options
Diffstat (limited to 'tokio/src/lib.rs')
-rw-r--r-- | tokio/src/lib.rs | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/tokio/src/lib.rs b/tokio/src/lib.rs index cd05cb55..1334eb88 100644 --- a/tokio/src/lib.rs +++ b/tokio/src/lib.rs @@ -348,8 +348,7 @@ cfg_fs! { pub mod fs; } -#[doc(hidden)] -pub mod future; +mod future; pub mod io; pub mod net; @@ -363,7 +362,14 @@ cfg_process! { pub mod process; } -pub mod runtime; +#[cfg(any(feature = "dns", feature = "fs", feature = "io-std"))] +mod blocking; + +cfg_rt_core! { + pub mod runtime; +} +#[cfg(all(not(feature = "rt-core"), feature = "rt-util"))] +mod runtime; pub(crate) mod coop; @@ -389,8 +395,8 @@ cfg_not_sync! { mod sync; } +pub mod task; cfg_rt_core! { - pub mod task; pub use task::spawn; } @@ -414,24 +420,24 @@ cfg_macros! { #[cfg(not(test))] // Work around for rust-lang/rust#62127 #[cfg_attr(docsrs, doc(cfg(feature = "macros")))] - pub use tokio_macros::main_threaded as main; + pub use tokio_macros::main; #[cfg_attr(docsrs, doc(cfg(feature = "macros")))] - pub use tokio_macros::test_threaded as test; + pub use tokio_macros::test; } cfg_not_rt_threaded! { #[cfg(not(test))] // Work around for rust-lang/rust#62127 - pub use tokio_macros::main_basic as main; - pub use tokio_macros::test_basic as test; + pub use tokio_macros::main_rt_core as main; + pub use tokio_macros::test_rt_core as test; } } - // Maintains old behavior + // Always fail if rt-core is not enabled. cfg_not_rt_core! { #[cfg(not(test))] - pub use tokio_macros::main; - pub use tokio_macros::test; + pub use tokio_macros::main_fail as main; + pub use tokio_macros::test_fail as test; } } |