# TreeDataGridSourceRef

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-controls-treedatagrid/struct-treedatagridsourceref/

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

```rust
struct TreeDataGridSourceRef
```

A shared core source as the value of a property of the grid (`Source`, `Model`): the core's
source trait object, compared by identity.

The conversions from the typed sources register the typed operations of their model type
([`register_tree_data_grid_model`](/docs/0.5.0/api/ferroui-controls-treedatagrid/selection/function-register_tree_data_grid_model/)), which the untyped presentation needs to create row and
cell selections and to follow the columns; a source handed over as an untyped
`Rc<dyn ITreeDataGridSource>` relies on its type having been registered.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/TreeDataGrid/FerroUI.Controls.TreeDataGrid/tree_data_grid_core_model.rs#L27)

## Members

- [`new`](#function-new)
- [`of`](#function-of)
- [`source`](#function-source)
- [`downcast`](#function-downcast)
- [`ptr_eq`](#function-ptr_eq)
- [`is`](#function-is)
- [`register_binding_conversion`](#function-register_binding_conversion)

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

### new

```rust
fn new(source: Rc<dyn ITreeDataGridSource>) -> Self
```

The handle of an untyped source.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/TreeDataGrid/FerroUI.Controls.TreeDataGrid/tree_data_grid_core_model.rs#L31)

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

### of

```rust
fn of<M: TreeModel, S: ITreeDataGridSourceOf<M> + 'static>(source: Rc<S>) -> Self
```

The handle of a typed source of models of `M`, registering the source and model types.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/TreeDataGrid/FerroUI.Controls.TreeDataGrid/tree_data_grid_core_model.rs#L36)

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

### source

```rust
fn source(self: &Self) -> &Rc<dyn ITreeDataGridSource>
```

The source.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/TreeDataGrid/FerroUI.Controls.TreeDataGrid/tree_data_grid_core_model.rs#L42)

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

### downcast

```rust
fn downcast<T: 'static>(self: &Self) -> Option<Rc<T>>
```

The source as the concrete source type `T`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/TreeDataGrid/FerroUI.Controls.TreeDataGrid/tree_data_grid_core_model.rs#L47)

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

### ptr_eq

```rust
fn ptr_eq(self: &Self, other: &TreeDataGridSourceRef) -> bool
```

Whether two handles hold the same source.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/TreeDataGrid/FerroUI.Controls.TreeDataGrid/tree_data_grid_core_model.rs#L52)

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

### is

```rust
fn is(self: &Self, source: &Rc<dyn ITreeDataGridSource>) -> bool
```

Whether the handle holds `source`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/TreeDataGrid/FerroUI.Controls.TreeDataGrid/tree_data_grid_core_model.rs#L57)

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

### register_binding_conversion

```rust
fn register_binding_conversion<M: TreeModel>()
```

Lets bindings deliver a value of the core's sources of models of `M` to a property of type
`Option<TreeDataGridSourceRef>` (or `TreeDataGridSourceRef`) on the current thread, as
`ItemsSource::register_binding_conversion` does for collections.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/TreeDataGrid/FerroUI.Controls.TreeDataGrid/tree_data_grid_core_model.rs#L64)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- [`Receiver`](/docs/0.5.0/api/ferroui-system/task/oneshot/struct-receiver/)
- `Any`
- `ToOwned`
- [`PropertyValue`](/docs/0.5.0/api/ferroui-base/trait-propertyvalue/)
- [`AnyValue`](/docs/0.5.0/api/ferroui-base/trait-anyvalue/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- [`TreeModel`](/docs/0.5.0/api/ferroui-treedatagrid-core/accessor/trait-treemodel/)
- `Clone`
- `PartialEq`
- `Debug`
- `Deref`
- `From<Rc<dyn ITreeDataGridSource>>`
- `From<Rc<FlatTreeDataGridSource<M>>>`
- `From<Rc<HierarchicalTreeDataGridSource<M>>>`

## Availability

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