Derive Macro crux_macros::Effect

source ·
#[derive(Effect)]
{
    // Attributes available to this derive:
    #[effect]
}
Expand description

Procedural macro to derive an Effect enum, with a variant for each non-skipped capability.

The default name of the Effect enum is “Effect”, but this can be overridden with the name attribute.

The default name of the app struct is “App”, but this can be overridden with the app attribute.

No Effect variant will be generated for fields annotated with #[effect(skip)].

e.g.

#[derive(Effect)]
#[effect(name = "MyEffect")]
pub struct MyCapabilities {
    pub http: crux_http::Http<MyEvent>,
    pub render: Render<MyEvent>,
    #[effect(skip)]
    pub compose: Compose<MyEvent>,
}