rollup merge of #21835: alexcrichton/iov2
This commit is an implementation of [RFC 576][rfc] which adds back the `std::io` module to the standard library. No functionality in `std::old_io` has been deprecated just yet, and the new `std::io` module is behind the same `io` feature gate. [rfc]: https://github.com/rust-lang/rfcs/pull/576 A good bit of functionality was copied over from `std::old_io`, but many tweaks were required for the new method signatures. Behavior such as precisely when buffered objects call to the underlying object may have been tweaked slightly in the transition. All implementations were audited to use composition wherever possible. For example the custom `pos` and `cap` cursors in `BufReader` were removed in favor of just using `Cursor<Vec<u8>>`. A few liberties were taken during this implementation which were not explicitly spelled out in the RFC: * The old `LineBufferedWriter` is now named `LineWriter` * The internal representation of `Error` now favors OS error codes (a 0-allocation path) and contains a `Box` for extra semantic data. * The io prelude currently reexports `Seek` as `NewSeek` to prevent conflicts with the real prelude reexport of `old_io::Seek` * The `chars` method was moved from `BufReadExt` to `ReadExt`. * The `chars` iterator returns a custom error with a variant that explains that the data was not valid UTF-8.
Showing
src/libstd/io/buffered.rs
0 → 100644
此差异已折叠。
src/libstd/io/cursor.rs
0 → 100644
src/libstd/io/error.rs
0 → 100644
src/libstd/io/impls.rs
0 → 100644
src/libstd/io/mod.rs
0 → 100644
此差异已折叠。
src/libstd/io/prelude.rs
0 → 100644
src/libstd/io/util.rs
0 → 100644
想要评论请 注册 或 登录