Use serde/bincode for event serialisation?
Created by: kaedroho
Just wondering if you would be interested in accepting a PR refactoring the event serialisation/deserialisation to use serde
and bincode
.
The current method requires transcoding all the information about the event into two u64
's[1]. I found this to be tricky and error-prone when I did it myself.
I think we can greatly simplify this by deriving Serialise/Deserialise traits using serde_derive[2] on the Event
enum, then use bincode[3] to perform the encoding into a Vec<u8>
which can be sent across the wire.
[1] https://github.com/redox-os/orbclient/blob/4f0214020ee79fb754128ea7770e35896f13d6cf/src/event.rs#L293-L296 [2] https://github.com/serde-rs/serde/tree/master/serde_derive [3] https://github.com/TyOverby/bincode