ags
Anonymous generic struct for rust.
Use Cases
Primarily used for types that are meant to be immediately type erased. For instance:
Anonymous generic struct for rust.
Primarily used for types that are meant to be immediately type erased. For instance:
#[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 {
..
})
}