# IDataTemplate

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-controls/templates/trait-idatatemplate/

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

```rust
trait IDataTemplate: ITemplateWithParam<Option<ferroui_base::BoxedValue>, Option<ferroui_base::Ref<crate::Control>>>
```

Interface representing a template used to build a control for a piece of
data.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/templates/i_data_template.rs#L7)

## Members

- [`match_`](#function-match_)
- [`as_recycling_data_template`](#function-as_recycling_data_template)
- [`as_typed_data_template`](#function-as_typed_data_template)
- [`as_tree_data_template`](#function-as_tree_data_template)
- [`as_any`](#function-as_any)

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

### match_

```rust
fn match_(self: &Self, data: Option<&BoxedValue>) -> bool
```

Checks to see if this data template matches the specified data.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/templates/i_data_template.rs#L9)

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

### as_recycling_data_template

```rust
fn as_recycling_data_template(self: &Self) -> Option<&dyn IRecyclingDataTemplate>
```

The template viewed as a recycling data template, if it is one.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/templates/i_data_template.rs#L12)

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

### as_typed_data_template

```rust
fn as_typed_data_template(self: &Self) -> Option<&dyn ITypedDataTemplate>
```

The template viewed as a typed data template, if it is one.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/templates/i_data_template.rs#L17)

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

### as_tree_data_template

```rust
fn as_tree_data_template(self: &Self) -> Option<&dyn ITreeDataTemplate>
```

The template viewed as a tree data template, if it is one.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/templates/i_data_template.rs#L22)

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

### as_any

```rust
fn as_any(self: &Self) -> Option<&dyn std::any::Any>
```

The implementing value, for casting to its concrete type
(`as_any()?.downcast_ref::<T>()`): the equivalent of `is`/`as` on the
contract. `None` for an implementation that does not expose itself.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/templates/i_data_template.rs#L29)

## Trait implementations

- [`IDataTemplate`](/docs/0.5.0/api/ferroui-controls/templates/trait-idatatemplate/)

## Availability

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