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 upfixed length arrays have their size encoded #86
Comments
|
I don't think that there is a way to do this with rustc-serialize. At least, there isn't a trait method for statically sized arrays. |
|
+1 for this idea |
|
This feature is only possible if we drop RustcSerialize support. I'm planning on doing that eventually, but it's on the backlist until serde hits 1.0 |
|
@TyOverby thank you! Just wanted to mention there is somebody else who need this =) |
|
Very much in support of this as well. Now that serde 0.9 is out, is it a good time to revisit this? (also now that custom derive will get stabilised in a few weeks) |
|
I'd like to chime in on this as well. Working with external data and this issue hit me, ended up having to use a fork. |
|
I also ran into this. What if we change the code to skip these lengths if the (I noticed https://github.com/serde-rs/bench says it is like bincode w/o these lengths) |
|
Since there's so much interest in this, I think I'll begin work on removing rustc-serialize support from bincode altogether. I've wanted to do this for a long time, but since serde is hitting 1.0 and macros are landing, I think it'll be pretty reasonable to move on to. |
|
rustc-serialize removal happening here: #95 |
|
That's great, thanks! Given that this will be a (very-) breaking change release, does it make sense to break things a little further and add endianness support? |
When a encoding a structure that contains a fixed length array the length of the array is also encoded. For example, this code:
Produces this output:
This behaviour makes it hard to use bincode for unpacking externally defined binary formats (e.g ELF headers). I suppose this library isn't really designed for that, but it works well enough for BE formats so it would be nice to see this fixed in the next major version.