stratum-mining / stratum

stratum
https://stratumprotocol.org
Other
221 stars 127 forks source link

No serde codec do not support enum #23

Open Fi3 opened 3 years ago

Fi3 commented 3 years ago

Is impossible to derive encodable and decodable for enums. Add this feature. https://github.com/stratum-mining/stratum/blob/main/protocols/v2/binary-sv2/no-serde-sv2/derive_codec/src/lib.rs

rrybarczyk commented 2 years ago

There are Encodable and Decodable features that are equivalent to the serde crate's Serialize + Deserialize features. Currently, these work on structs:

#[derive(Encodable, Decodable)]
struct Struct { }

We want them to also work on enum's:

#[derive(Encodable, Decodable)]
enum Enum { }

This is a nice to have, but not required.