Struct utf8::BufReadDecoder

source ·
pub struct BufReadDecoder<B: BufRead> { /* private fields */ }
Expand description

Wraps a std::io::BufRead buffered byte stream and decode it as UTF-8.

Implementations

This is to Read::read_to_string what String::from_utf8_lossy is to String::from_utf8.

Same as BufReadDecoder::next_strict, but replace UTF-8 errors with U+FFFD.

Decode and consume the next chunk of UTF-8 input.

This method is intended to be called repeatedly until it returns None, which represents EOF from the underlying byte stream. This is similar to Iterator::next, except that decoded chunks borrow the decoder (~iterator) so they need to be handled or copied before the next chunk can start decoding.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.