Skip to main content

Effect

Derive Macro Effect 

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

Derive Effect: an enum’s variants become the app’s published effects — work with no document delta, invoked by buttons, the palette, agents and scripts alike. See tilo_resource::effect.

#[effect(operation = "app.effects")] names the vocabulary’s operation type; device_only beside it marks every effect device-only. Each variant is unit or has named fields (the effect’s typed parameters, #[param("…")] describing one); its id is the variant name in kebab case and its label the first doc line. Variant options: #[effect(label = "...", view, row, job, cancellable, returns, destructive, privileged, idempotent, device_only, programmatic, untrusted, risk = "path", kind = "read")]. A device_only effect reaches the files, hardware or services of the device it runs on: only the person at that device may invoke it. In a vocabulary marked device_only, #[effect(device_only = false)] exempts one effect that reaches nothing of the device (a personal setting). Generates impl Effect and one ActionRef constant per variant (Backups::RESTORE) for binding controls.