# ModelTypes

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/data/model/struct-modeltypes/

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

```rust
struct ModelTypes
```

The per-thread table of model type metadata.

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

## Members

- [`register`](#function-register)
- [`register_notifying_collection`](#function-register_notifying_collection)
- [`is_registered`](#function-is_registered)
- [`find`](#function-find)

<a id="function-register"></a>

### register

```rust
fn register<T: PartialEq + 'static>(describe: impl FnOnce(ModelTypeBuilder<T>) -> ModelTypeBuilder<T>)
```

Registers (or replaces) the metadata of `T`.

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

<a id="function-register_notifying_collection"></a>

### register_notifying_collection

```rust
fn register_notifying_collection<T: INotifyCollectionChanged + PartialEq + 'static>()
```

Registers a collection type whose only metadata is its change notifications: a
collection held by value as a handle (an instantiation of the notifying list that
a typed list declaration names). An indexer of a binding path over such a
collection follows its changes. Unlike `register` it does not
make the type a reference type: its values are handles.

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

<a id="function-is_registered"></a>

### is_registered

```rust
fn is_registered(id: TypeId) -> bool
```



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

<a id="function-find"></a>

### find

```rust
fn find(value: &dyn AnyValue) -> Option<Rc<ModelType>>
```

The metadata of the type of `value`, if it was registered.

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

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ErasedDestructor`
- `IntoEither`

## Availability

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