# AccessorBinding

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

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

```rust
struct AccessorBinding<M: TreeModel, V: Clone + 'static>
```

A binding of the value an `Accessor` reads from a model: the reference's
`TypedBindingExpression<TModel, TValue>` instantiated for a cell (`InstanceForCell`).

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

## Members

- [`new`](#function-new)
- [`with_observer`](#function-with_observer)
- [`root`](#function-root)
- [`accessor`](#function-accessor)
- [`value`](#function-value)

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

### new

```rust
fn new(accessor: Accessor<M, V>, root: Option<Rc<M>>) -> Rc<Self>
```

A binding of `accessor` on `root`.

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

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

### with_observer

```rust
fn with_observer(accessor: Accessor<M, V>, observer: Option<Rc<PropertyPathObserver<M>>>, root: Option<Rc<M>>) -> Rc<Self>
```

A binding of `accessor` on `root` that follows the path with `observer`, compiled once
for a column and shared by its cells.

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

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

### root

```rust
fn root(self: &Self) -> Option<Rc<M>>
```

The model the binding reads.

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

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

### accessor

```rust
fn accessor(self: &Self) -> &Accessor<M, V>
```

The accessor of the binding.

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

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

### value

```rust
fn value(self: &Self) -> Option<V>
```

The current value, if the binding has a root (`GetResult`).

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

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- [`ICellBinding<V>`](/docs/0.5.0/api/ferroui-controls-treedatagrid/models/trait-icellbinding/)
- [`IRetargetableCellBinding`](/docs/0.5.0/api/ferroui-controls-treedatagrid/models/trait-iretargetablecellbinding/)
- `Drop`

## Availability

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