Open
Description
The behavior of serde_json::from_reader is that it expects the input stream to end after the deserialized object. If the stream contains trailing data, that is considered an error. If the stream does not end, such as in the case of a persistent socket connection, then from_reader would not return. This is the correct behavior for from_reader for example when deserializing from a File, in which we don't want to silently allow trailing garbage. It is possible instead to deserialize from a prefix of an input stream without looking for EOF by managing your own Deserializer:
let mut de = serde_json::Deserializer::from_reader(stream);
let t = T::deserialize(&mut de)?;