extern crate serde_crate as serde; use auto_enums::enum_derive; enum Enum { A(A), B(B), } impl ::serde::ser::Serialize for Enum where A: ::serde::ser::Serialize, B: ::serde::ser::Serialize, { #[inline] fn serialize<__S>( &self, serializer: __S, ) -> ::core::result::Result<__S::Ok, __S::Error> where __S: ::serde::ser::Serializer, { match self { Enum::A(x) => ::serialize(x, serializer), Enum::B(x) => ::serialize(x, serializer), } } } fn main() {}