Skip to main content

from_reader

Function from_reader 

Source
pub fn from_reader<R, T>(reader: R) -> Result<T>
where R: Read, T: for<'de> NsonDeserialize<'de>,
Expand description

Deserialize from a std::io::Read (requires the std feature).

The input is pulled incrementally (see StreamDecoder), so decoding starts before the whole payload has arrived. The target type must be deserializable for any lifetime (owned): borrowed inputs (&str, &[u8], nextjson::Bytes) cannot come from a stream.