You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We currently have one trait (Readable) for reading objects with two totally different semantics - objects may know when to stop reading cause they have length descriptors and some objects may not (cause they just read to end). We should really have two different traits for the two types of objects cause its unsafe to confuse them.
The text was updated successfully, but these errors were encountered:
I don't see how that would be any more unsafe than reading smth. from a stream in general. It's either long enough, or it isn't. If you try to read something after reading an object that reads to the end, the stream has no data left. I may be missing something here. Maybe Matt had a more specific example in mind?
Its not "unsafe" in the Rust "can lead to language-undefined behavior" definition, but rather unsafe in the "can lead to bugs" sense. If you have an object which is being read and it tries to read some sub-object which unexpectedly consumes the whole stream things may spuriously fail to deserialize or read the wrong fields.
We currently have one trait (
Readable
) for reading objects with two totally different semantics - objects may know when to stop reading cause they have length descriptors and some objects may not (cause they just read to end). We should really have two different traits for the two types of objects cause its unsafe to confuse them.The text was updated successfully, but these errors were encountered: