Function pot::from_reader

source ยท
pub fn from_reader<T, R>(reader: R) -> Result<T>
where T: DeserializeOwned, R: Read,
Expand description

Restores a previously Pot-serialized value from a Read implementer.

let mut serialized = Vec::new();
pot::to_writer(&"hello world", &mut serialized).unwrap();
let deserialized = pot::from_reader::<String, _>(&serialized[..]).unwrap();
assert_eq!(deserialized, "hello world");