{% macro declare_union(name, union) -%}

{# Debug and PartialEq are included for convenience, testing, and debugging. -#}
#[derive(Debug, PartialEq, MojomParse)]
{%- if union|should_derive_clone %}
#[derive(Clone)]
{%- endif %}
pub enum {{name}} {
{%- for field in union.fields %}
  {{field.name}}({{field.kind|to_rust_type}}),
{%- endfor %}
}

{%- endmacro -%}