Skip to main content

from_reader

Function from_reader 

Source
pub fn from_reader<T: DeserializeOwned, R: Read>(reader: R) -> Result<T, Error>
Expand description

Deserializes an item from a reader.

The reader is read to the end, no data may follow the item. The reader does not need to be buffered. To read more than one item use DeserializerConfig::reader.

let value: Vec<u32> =
    deser_msgpack::from_reader(&[0x92, 0x01, 0x02][..]).unwrap();
assert_eq!(value, [1, 2]);