# ferro_static_type

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

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

```rust
macro_rules! ferro_static_type
```

Declares the runtime type of a type that is not a class: a type that
owns attached properties and cannot be instantiated as an object.

```ignore
pub struct KeyboardNavigation;
ferro_static_type!(KeyboardNavigation);

ferro_properties! {
    impl KeyboardNavigation {
        pub fn tab_index_property() -> AttachedProperty<i32> { .. }
    }
}
```

Unlike a hand-written `impl StaticType`, the runtime type carries the
static initialisation of the type (its `ferro_properties!` block and its
`fn static_constructor()`, as for a class), so its properties are found
by owner type and name before any accessor was called, and it knows its
module, hence its namespace.

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

## Availability

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