serde_repr 0.1.20

Derive Serialize and Deserialize that delegates to the underlying repr of a C-like enum.
Documentation
1
2
3
4
5
6
7
8
9
10
11
use serde_repr::Serialize_repr;

#[derive(Serialize_repr)]
enum SmallPrime {
    Two = 2,
    Three = 3,
    Five = 5,
    Seven = 7,
}

fn main() {}