# ferro_model

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

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

```rust
macro_rules! ferro_model
```

Declares a model type: gives it identity equality (so shared instances can
travel through bindings and be stored in properties) and its binding
metadata.

```ignore
ferro_model!(PersonVm, |b| b
    .notify_property_changed()
    .property::<Value<String>>("Name", |vm| vm.name(), |vm, v| vm.set_name(v))
    .read_only::<Value<i32>>("Age", |vm| vm.age())
    .method("Save", |vm, _| vm.save()));
```

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/model/model_type.rs#L369)

## Availability

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