# ModelType

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

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

```rust
struct ModelType
```

The binding metadata of a model type: a type outside the class hierarchy
(typically a view model) that bindings with a string path can navigate.

This is what stands in for reflection: the properties and methods a type
declares by name, and how to reach the notification interfaces it
implements from an untyped value.

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

## Members

- [`value_type`](#function-value_type)
- [`properties`](#function-properties)
- [`find_property`](#function-find_property)
- [`find_method`](#function-find_method)
- [`as_notify_property_changed`](#function-as_notify_property_changed)
- [`as_notify_data_error_info`](#function-as_notify_data_error_info)
- [`as_list`](#function-as_list)
- [`as_indexer`](#function-as_indexer)
- [`as_array`](#function-as_array)
- [`as_notify_collection_changed`](#function-as_notify_collection_changed)

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

### value_type

```rust
fn value_type(self: &Self) -> ValueType
```



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

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

### properties

```rust
fn properties(self: &Self) -> &[Rc<dyn IPropertyInfo>]
```

The declared properties.

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

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

### find_property

```rust
fn find_property(self: &Self, name: &str) -> Option<Rc<dyn IPropertyInfo>>
```

Finds a declared property by name.

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

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

### find_method

```rust
fn find_method(self: &Self, name: &str) -> Option<Rc<ModelMethod>>
```

Finds a declared method by name.

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

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

### as_notify_property_changed

```rust
fn as_notify_property_changed<'a>(self: &Self, value: &'a dyn AnyValue) -> Option<&'a dyn INotifyPropertyChanged>
```

The property change notifications of `value`, if its type declared
them.

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

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

### as_notify_data_error_info

```rust
fn as_notify_data_error_info<'a>(self: &Self, value: &'a dyn AnyValue) -> Option<&'a dyn INotifyDataErrorInfo>
```

The validation error notifications of `value`, if its type declared
them.

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

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

### as_list

```rust
fn as_list<'a>(self: &Self, value: &'a dyn AnyValue) -> Option<&'a dyn IBindableList>
```

Indexed access to `value`, if its type declared itself a list.

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

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

### as_indexer

```rust
fn as_indexer<'a>(self: &Self, value: &'a dyn AnyValue) -> Option<&'a dyn IBindableIndexer>
```

The indexer of `value`, if its type declared one.

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

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

### as_array

```rust
fn as_array<'a>(self: &Self, value: &'a dyn AnyValue) -> Option<&'a dyn IBindableArray>
```

Array access to `value`, if its type declared itself an array.

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

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

### as_notify_collection_changed

```rust
fn as_notify_collection_changed<'a>(self: &Self, value: &'a dyn AnyValue) -> Option<&'a dyn INotifyCollectionChanged>
```

The collection change notifications of `value`, if its type declared
them or is a notifying list.

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

## 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/).
