I need to serialize a struct to [u8] but remove any gaps between members.
Also, when deserializing [u8] to the struct, any necessary gaps must be added back.
I can define a
repr(packed) and a
repr(rust) version for this structure, but I have several such kinds of structures. This makes the work rather boring.
Is there any better way to do this?
Or is there a way to automatically generate
repr(packed) versions of a structure?
My final solution:
Sorry, I accessed the wrong forum…