1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
# ags Anonymous generic struct for rust. ## Use Cases Primarily used for types that are meant to be immediately type erased. For instance: ```rust #[ags::anonymous_generic_struct] struct CardTemplate { pub name: impl AsRef<str>, pub cost: impl CardCost, pub on_play: impl CardOnPlay, } #[ags::anonymous_generic_struct] impl Card for CardTemplate { .. } pub fn create_card() -> Box<dyn Card> { Box::new(CardTemplate { .. }) } ```