2 releases
0.1.1 | Oct 21, 2019 |
---|---|
0.1.0 | Oct 21, 2019 |
#5 in #miniserde
17KB
401 lines
miniserde-derive-enum
Miniserde derive macros that support enum
s.
Provides a minimal Serialize_enum
, Deserialize_enum
derive macros
for enum
support in Miniserde.
Example
use miniserde::{Serialize, Deserialize};
use miniserde_derive_enum::{Serialize_enum, Deserialize_enum};
pub fn main() {
#[derive(Serialize_enum, Deserialize_enum)]
enum E {
Unit,
Struct { a: u8, b: String, c: Box<E> },
Tuple(u8, String),
}
}
License: MIT OR Apache-2.0
lib.rs
:
Miniserde derive macros that support enum
s.
Provides a minimal Serialize_enum
, Deserialize_enum
derive macros
for enum
support in Miniserde.
Example
use miniserde_derive_enum::{Serialize_enum, Deserialize_enum};
pub fn main() {
#[derive(Serialize_enum, Deserialize_enum)]
enum E {
Unit,
Struct { a: u8, b: String, c: Box<E> },
Tuple(u8, String),
}
}
Dependencies
~1.5MB
~37K SLoC