A really ugly hack to get generic enum serialization

This commit is contained in:
Erick Tryzelaar
2015-02-20 08:21:15 -08:00
parent adc6057574
commit d4dcf8e75d
2 changed files with 150 additions and 29 deletions
+32
View File
@@ -0,0 +1,32 @@
#![feature(plugin)]
#![plugin(serde2_macros)]
extern crate serde2;
trait Trait {
type Type;
}
#[derive_serialize]
//#[derive_deserialize]
enum Enum<'a, A: 'a, B: /* Trait + */ 'a, C> where C: /* Trait + */ 'a {
Unit,
Seq(
i8,
&'a A,
&'a B,
//B::Type,
&'a C,
//<C as Trait>::Type,
),
Map {
a: i8,
b: &'a A,
c: &'a B,
//d: B::Type,
e: &'a C,
//f: <C as Trait>::Type,
},
}
fn main() {}