-
-
Notifications
You must be signed in to change notification settings - Fork 279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Serialize and deserialize bytes without length #255
Comments
In case anyone reading this is having the same problem, we found a library that is probably going to simplify a lot of things: https://github.com/libpnet/libpnet |
A few random thoughts:
|
Hey @TyOverby, I am reading through bincode to learn more about serde (thanks for your work on this btw), and I'd just like to confirm my understanding of something here. Initially my thought was that bincode could omit encoding the length before a serde If you don't mind sharing, what would your approach be for implementing this as a separate crate? Would you work entirely outside the serde ecosystem? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I and a friend are implementing a binary network protocol and wanted to serialize and deserialize structs to and from raw bytes, without padding. Some of these structs contain a payload field at the end, which can be arbitrarily large, but is always the last to be read or written. The problem we now faced is that
bincode
always writes the length (inserialize_bytes
) and expects it to be present when deserializing as well. I can't think of a good way to offer this option, considering the limitations of the traits provided by serde, but I really think this should be possible. Any thoughts?The text was updated successfully, but these errors were encountered: