pub fn decode_from_read<T, R>(
reader: R,
) -> Result<T, ReadError<<T::Decoder as Decoder>::Error>>Expand description
Decodes an object from a buffered reader.
§Performance
For unbuffered readers (like std::fs::File or std::net::TcpStream),
consider wrapping your reader with std::io::BufReader in order to use
this function. This avoids frequent small reads, which can significantly
impact performance.
§Errors
Returns ReadError::Decode if the decoder encounters an error while parsing
the data, or ReadError::Io if an I/O error occurs while reading.