# static_view_mapping

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-static-view-locator-macros/proc_macro-static_view_mapping/

**proc macro** · [`ferroui-static-view-locator-macros`](/docs/0.5.0/api/ferroui-static-view-locator-macros/) · v0.5.0

```rust
attr macro static_view_mapping!
```

Maps a view model type to a view type on a locator (`[StaticViewMapping(typeof(VM), typeof(V))]`):
the final override of the mapping of the view model, for types that do not follow the naming
rules. Repeatable; the types are named as in the module of the locator.

```ignore
#[static_view_locator]
#[static_view_mapping(LoginViewModel, LogInView)]
#[static_view_mapping(DashboardModel, DashboardScreen)]
pub struct ViewLocator;
```

[`static_view_locator`](/docs/0.5.0/api/ferroui-static-view-locator-macros/proc_macro-static_view_locator/) reads the mappings below it; a mapping written above it is left in
place by this attribute, which only checks it.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/StaticViewLocator/FerroUI.StaticViewLocator.Macros/lib.rs#L75)

## Availability

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