std: Stabilize portions of the io
module by alexcrichton · Pull Request #23010 · rust-lang/rust (original) (raw)
The new io
module has had some time to bake and this commit stabilizes some of
the utilities associated with it. This commit also deprecates a number of
std::old_io::util
functions and structures.
These items are now #[stable]
Cursor
Cursor::{new, into_inner, get_ref, get_mut, position, set_position}
- Implementations of I/O traits for
Cursor<T>
- Delegating implementations of I/O traits for references and
Box
pointers - Implementations of I/O traits for primitives like slices and
Vec<T>
ReadExt::bytes
Bytes
(and impls)ReadExt::chain
Chain
(and impls)ReadExt::take
(and impls)BufReadExt::lines
Lines
(and impls)io::copy
io::{empty, Empty}
(and impls)io::{sink, Sink}
(and impls)io::{repeat, Repeat}
(and impls)
These items remain #[unstable]
- Core I/O traits. These may want a little bit more time to bake along with the
commonly used methods like
read_to_end
. BufReadExt::split
- this function may be renamed to not conflict withSliceExt::split
.Error
- there are a number of questions about its representation,ErrorKind
, and usability.
These items are now #[deprecated]
in old_io
LimitReader
- usetake
insteadNullWriter
- useio::sink
insteadZeroReader
- useio::repeat
insteadNullReader
- useio::empty
insteadMultiWriter
- usebroadcast
insteadChainedReader
- usechain
insteadTeeReader
- usetee
insteadcopy
- useio::copy
instead
[breaking-change]