ags 0.0.1

Anonymous generic struct for rust.
Documentation

ags

Anonymous generic struct for rust.

Use Cases

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 {
        ..
    })
}