I have a struct like this
struct A {
id: i8,
key: i16,
name: String,
values: Vec<String>
}
I wish to convert it to bytes and pad it with the converted size so I can send it over TCP. The string data should be sent as itself. I will worry about the endianness of things once this part is done.
I am using rustc 1.0.0-beta.3 (5241bf9c3 2015-04-25) (built 2015-04-25)
. I looked at How to convert 'struct' to '&[u8]'?, but bincode is having compilation problems with the beta. I am hoping to find a non-external lib way for doing the above.