use ruststep_derive::{as_holder, Holder}; use std::collections::HashMap; #[derive(Debug, Clone, PartialEq, Default)] pub struct Table { a: HashMap, b: HashMap, } #[derive(Debug, Clone, PartialEq, Holder)] #[holder(table = Table)] #[holder(field = a)] #[holder(generate_deserialize)] pub struct A { pub x: f64, } #[derive(Debug, Clone, PartialEq, Holder)] #[holder(table = Table)] #[holder(field = b)] #[holder(generate_deserialize)] pub struct B { pub y: f64, } #[derive(Debug, Clone, PartialEq, Holder)] #[holder(table = Table)] #[holder(generate_deserialize)] pub enum S1 { #[holder(use_place_holder)] A(Box), #[holder(use_place_holder)] B(Box), } #[derive(Debug, Clone, PartialEq, Holder)] #[holder(table = Table)] #[holder(generate_deserialize)] pub enum S2 { #[holder(use_place_holder)] A(Box), // mix primitive type P(f64), } fn main() {}