# ferro_markup_enum

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/macro-ferro_markup_enum/

**macro** · [`ferroui-base`](/docs/0.5.0/api/ferroui-base/) · v0.5.0

```rust
macro_rules! ferro_markup_enum
```

Declares the markup metadata of an enumeration: its members by name.

```ignore
ferro_markup_enum!(Dock { Left, Bottom, Right, Top });

// A member whose Rust variant has another name (`Self` is reserved):
ferro_markup_enum!(RelativeSourceMode { DataContext, TemplatedParent, Self = Self_, FindAncestor });

// A set of flags (a `bitflags!` type): members name their constants.
ferro_markup_enum!(flags RoutingStrategies {
    Direct = RoutingStrategies::DIRECT,
    Tunnel = RoutingStrategies::TUNNEL,
    Bubble = RoutingStrategies::BUBBLE,
});

// With attributes or another namespace:
ferro_markup_enum!(Dock { Left, Bottom, Right, Top }, { namespace: "FerroUI.Controls" });
```

The members of a plain enumeration are its variants (their numeric value
is the discriminant); the members of a flags type are constants with a
`bits()` method. The untyped form of a member is a value of the type
itself. Implements `MarkupTyped`.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/metadata/markup_macros.rs#L305)

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
