Closed mattgathu closed 10 months ago
SstMetadata
has more bytes than SstIndex
, so you can deseiralize SstIndex
just fine. If you want this to be a runtime error, you can set Options::reject_trailing_bytes
For more information on how the bincode format works you can check the spec
Thank you.
I have two similar types that I ser/de with bincode:
During a refactor I realized that the following deserialization code does not error out:
I'm wondering why the
SstIndex
deserialization works? Is this behaviour documented somewhere? ThanksEDIT: I went ahead a did a simple reproduction:
cargo run
produces: