-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removes dependencies between Tokio feature flags. For example, `process` should not depend on `sync` simply because it uses the `mpsc` channel. Instead, feature flags represent **public** APIs that become available with the feature enabled. When the feature is not enabled, the functionality is removed. If another Tokio component requires the functionality, it is stays as `pub(crate)`. The threaded scheduler is now exposed under `rt-threaded`. This feature flag only enables the threaded scheduler and does not include I/O, networking, or time. Those features must be explictly enabled. A `full` feature flag is added that enables all features. `stdin`, `stdout`, `stderr` are exposed under `io-std`. Macros are used to scope code by feature flag.
- Loading branch information
1 parent
13b6e99
commit 0d38936
Showing
49 changed files
with
1,091 additions
and
914 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
#![cfg_attr(not(feature = "blocking"), allow(dead_code, unused_imports))] | ||
|
||
//! Perform blocking operations from an asynchronous context. | ||
|
||
mod pool; | ||
pub(crate) use self::pool::{spawn_blocking, BlockingPool, Spawner}; | ||
cfg_blocking_impl! { | ||
mod pool; | ||
pub(crate) use pool::{spawn_blocking, BlockingPool, Spawner}; | ||
|
||
mod schedule; | ||
mod task; | ||
mod schedule; | ||
mod task; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,71 +1,75 @@ | ||
mod async_buf_read_ext; | ||
#[allow(unreachable_pub)] // https://github.com/rust-lang/rust/issues/57411 | ||
pub use self::async_buf_read_ext::AsyncBufReadExt; | ||
#![allow(unreachable_pub)] // https://github.com/rust-lang/rust/issues/57411 | ||
|
||
mod async_read_ext; | ||
#[allow(unreachable_pub)] // https://github.com/rust-lang/rust/issues/57411 | ||
pub use self::async_read_ext::AsyncReadExt; | ||
cfg_io_util! { | ||
mod async_buf_read_ext; | ||
pub use async_buf_read_ext::AsyncBufReadExt; | ||
|
||
mod async_write_ext; | ||
#[allow(unreachable_pub)] // https://github.com/rust-lang/rust/issues/57411 | ||
pub use self::async_write_ext::AsyncWriteExt; | ||
mod async_read_ext; | ||
pub use async_read_ext::AsyncReadExt; | ||
|
||
mod buf_reader; | ||
#[allow(unreachable_pub)] // https://github.com/rust-lang/rust/issues/57411 | ||
pub use self::buf_reader::BufReader; | ||
mod async_write_ext; | ||
pub use async_write_ext::AsyncWriteExt; | ||
|
||
mod buf_stream; | ||
#[allow(unreachable_pub)] // https://github.com/rust-lang/rust/issues/57411 | ||
pub use self::buf_stream::BufStream; | ||
mod buf_reader; | ||
pub use buf_reader::BufReader; | ||
|
||
mod buf_writer; | ||
#[allow(unreachable_pub)] // https://github.com/rust-lang/rust/issues/57411 | ||
pub use self::buf_writer::BufWriter; | ||
mod buf_stream; | ||
pub use buf_stream::BufStream; | ||
|
||
mod chain; | ||
mod buf_writer; | ||
pub use buf_writer::BufWriter; | ||
|
||
mod copy; | ||
#[allow(unreachable_pub)] // https://github.com/rust-lang/rust/issues/57411 | ||
pub use self::copy::{copy, Copy}; | ||
mod chain; | ||
|
||
mod empty; | ||
#[allow(unreachable_pub)] // https://github.com/rust-lang/rust/issues/57411 | ||
pub use self::empty::{empty, Empty}; | ||
mod copy; | ||
pub use copy::{copy, Copy}; | ||
|
||
mod flush; | ||
mod empty; | ||
pub use empty::{empty, Empty}; | ||
|
||
mod lines; | ||
#[allow(unreachable_pub)] // https://github.com/rust-lang/rust/issues/57411 | ||
pub use self::lines::Lines; | ||
mod flush; | ||
|
||
mod read; | ||
mod read_exact; | ||
mod read_line; | ||
mod read_to_end; | ||
mod read_to_string; | ||
mod read_until; | ||
mod lines; | ||
pub use lines::Lines; | ||
|
||
mod repeat; | ||
#[allow(unreachable_pub)] // https://github.com/rust-lang/rust/issues/57411 | ||
pub use self::repeat::{repeat, Repeat}; | ||
mod read; | ||
mod read_exact; | ||
mod read_line; | ||
|
||
mod shutdown; | ||
mod read_to_end; | ||
cfg_process! { | ||
pub(crate) use read_to_end::read_to_end; | ||
} | ||
|
||
mod sink; | ||
#[allow(unreachable_pub)] // https://github.com/rust-lang/rust/issues/57411 | ||
pub use self::sink::{sink, Sink}; | ||
mod read_to_string; | ||
mod read_until; | ||
|
||
mod split; | ||
#[allow(unreachable_pub)] // https://github.com/rust-lang/rust/issues/57411 | ||
pub use self::split::Split; | ||
mod repeat; | ||
pub use repeat::{repeat, Repeat}; | ||
|
||
mod take; | ||
#[allow(unreachable_pub)] // https://github.com/rust-lang/rust/issues/57411 | ||
pub use self::take::Take; | ||
mod shutdown; | ||
|
||
mod write; | ||
mod write_all; | ||
mod sink; | ||
pub use sink::{sink, Sink}; | ||
|
||
// used by `BufReader` and `BufWriter` | ||
// https://github.com/rust-lang/rust/blob/master/src/libstd/sys_common/io.rs#L1 | ||
const DEFAULT_BUF_SIZE: usize = 8 * 1024; | ||
mod split; | ||
pub use split::Split; | ||
|
||
mod take; | ||
pub use take::Take; | ||
|
||
mod write; | ||
mod write_all; | ||
|
||
// used by `BufReader` and `BufWriter` | ||
// https://github.com/rust-lang/rust/blob/master/src/libstd/sys_common/io.rs#L1 | ||
const DEFAULT_BUF_SIZE: usize = 8 * 1024; | ||
} | ||
|
||
cfg_not_io_util! { | ||
cfg_process! { | ||
mod read_to_end; | ||
// Used by process | ||
pub(crate) use read_to_end::read_to_end; | ||
} | ||
} |
Oops, something went wrong.