I'm trying to serialize a struct into bytes in order to send it down a pipe. I found How to convert 'struct' to '&[u8]'?, which looks good. I'm using stable Rust, and trying to derive RustcEncodable
or RustcDecodable
results in a compiler error:
error: `#[derive]` for custom traits is not stable enough for use and is subject to change (see issue #29644)
--> src/main.rs:26:10
|
26 | #[derive(RustEncodable)]
| ^^^^^^^^^^^^^
error: aborting due to previous error
My initial instinct would be to implement the trait for my struct instead of deriving it, but the documentation for rustc-serialize is not very clear
I'm using Rust 1.12.1.