Skip to main content

Crate spark_derive

Crate spark_derive 

Source
Expand description

Proc macros for Spark.

  • #[spark_component(template = "spark/counter")] — on a struct: emits Serialize/Deserialize/Default derives, the Component impl, the DynComponent impl, and the inventory::submit! for ComponentEntry.
  • #[spark_actions] — on impl Counter { … }: scans the impl block for pub async fns (treated as actions), #[spark_mount], #[spark_on(…)], #[spark_updated(…)], and emits DispatchEntry, ListenerEntry, MountEntry submissions plus a generated dispatcher function. The original impl block is preserved (minus the marker attributes).
  • #[spark_mount], #[spark_on("event")], #[spark_updated("field")] — marker attributes consumed by #[spark_actions]. On their own they compile to a no-op (so cargo check works even if #[spark_actions] is missing — the actions simply won’t be registered).

Attribute Macros§

actions
component
mount
on
updated