Deserializing Binary Data Files in Rust · Michael-F-Bryan

The other day, someone on the Rust user forums posted a question that really nerd-sniped me. They had data generated by a C++ program and were wanting to load it into a Rust program, but when asked what format the data was in the author didn’t provide some something like a JSON schema or Protobuf file, instead they just got the definition for a C struct.
A common method for “serializing” data in C is to create a struct and directly write its bytes into a file, the “deserializing” is …