Why do I get an UnsupportedType error when serializing to TOML with a manually implemented Serialize for an enum with struct variants?
问题 I'm trying to implement Serialize for an enum that includes struct variants. The serde.rs documentation indicates the following: enum E { // Use three-step process: // 1. serialize_struct_variant // 2. serialize_field // 3. end Color { r: u8, g: u8, b: u8 }, // Use three-step process: // 1. serialize_tuple_variant // 2. serialize_field // 3. end Point2D(f64, f64), // Use serialize_newtype_variant. Inches(u64), // Use serialize_unit_variant. Instance, } With that in mind, I proceeded to