Expand description
Traits and types for UTF-8 I/O
Structs§
- Utf8
Duplexer - An interactive UTF-8 stream, combining
Utf8ReaderandUtf8Writer. - Utf8
Reader - A
Readimplementation which translates from an inputReadproducing an arbitrary byte sequence into a valid UTF-8 sequence with invalid sequences replaced by U+FFFD (REPLACEMENT CHARACTER) in the manner ofString::from_utf8_lossy, where scalar value encodings never straddlereadcalls (callers can dostr::from_utf8and it will always succeed). - Utf8
Writer - A
Writeimplementation which translates into an outputWriteproducing a valid UTF-8 sequence from an arbitrary byte sequence from an arbitrary byte sequence. Attempts to write invalid encodings are reported as errors.
Traits§
- ReadStr
- Extend the
Readtrait withread_str, a method for reading UTF-8 data. - Write
Str - Add a convenience and optimizing method for writing from
str.
Functions§
- copy_
str - Like
std::io::copy, but for streams that can operate directly on strings, so we can avoid re-validating them as UTF-8. - default_
read_ exact_ str - Default implementation of
ReadStr::read_exact_str. - default_
write_ fmt - Default implementation of
Write::write_fmt, in terms ofWriteStr::write_str. - default_
write_ str - Default implementation of
WriteStr::write_str, in terms ofWrite::write_all.