io: bring back split utility (#1521)

Bring back `split` utility as a free fn instead of a method on
`AsyncRead`. This utility wraps the `stream` in an `Arc` and uses mutual
exclusion to ensure correct access.

Additionally, the specialized `split_mut` fn on TcpStream and UdsStream
is promoted to `split`.
This commit is contained in:
Carl Lerche
2019-08-30 20:46:07 -07:00
committed by GitHub
parent 951827229a
commit 2f91c85ad8
14 changed files with 284 additions and 325 deletions
+3
View File
@@ -22,6 +22,9 @@ mod async_write;
#[cfg(feature = "util")]
mod io;
#[cfg(feature = "util")]
pub mod split;
pub use self::async_buf_read::AsyncBufRead;
pub use self::async_read::AsyncRead;
pub use self::async_write::AsyncWrite;