Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGet number of bytes written/read? #54
Comments
|
Hmm, on second though, I'm not sure how easy this is to add to code. |
|
If you use the structs defined here to do the deserialization you can grab the number of bytes read. By using the function encoded_size, you can get the size of the struct as it would be on the wire. |
|
It doesn't seem to be documented how to use those structs directly. |
|
I've added documentation to rustc-serizlize DecoderReader and serde Deserializer. The |
|
Thanks for this. That’s quite handy. Not sure if it bothers you, but there’s a typo in the docs – “bytes_red”. Otherwise good.
|
|
aah! Thanks! |
Could the
serialize_intoanddeserialize_frommethods return the number of bytes written/read respectively? This would both handy and more efficient, since you already have to compute these values in these methods, and it thus saves an extra call toserialized_size.