Bincode compatibility guarantees?

#1

What binary serialization/deserialization guarantees that bincode make with regarding:

  1. serializing via bincode version X
  2. deserializing via bincode version Y

?

On one hand, we want strong guarantees. On the other hand, having formats written in stone prevents “improved methods of serialization” (if they come up). How is bincode dealing with this balance?

#2

As far as I know, it doesn’t. You tell it what to [de]serialize, it does that and only that.

#3

I’m not sure if I misread your answer or if you misread my question.

Are you saying that to deserialize a bincode serialized object, you have to use the precise bincode version, and nothing else is guaranteed to work?

#4

Oh! You mean “serializing via (bincode version X)”, not “(serializing via bincode) version X”.

bincode is largely just the direct representation of what you give it. I don’t know why it would ever want to change, given that it’s specifically designed to be simple. Even if it did, it would presumably just bump the major version, and then you could use both if you need backward compatibility.

#5

Looks like there’s already an open issue asking this question.