pub fn from_reader<R, T>(r: R) -> Result<T>where
R: Read,
T: DeserializeOwned,Available on crate feature
std only.Expand description
Deserializes an instance of T from the bytes of an io::Read type.
The entire io::Read source is consumed, and it is an error if there is
trailing data. If trailing data is expected, then the Deserializer
should be constructed directly. See Deserializer::byte_offset() for an
example.
ยงErrors
Deserialization can fail if the data is not valid, if the data cannot be
deserialized into an instance of T, if there is trailing data, and other
IO errors.