# TreeDataGridBindingAccessor

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

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

```rust
struct TreeDataGridBindingAccessor
```

The accessor of the value a binding selects from a model (`TreeDataGridBindingAccessor`).

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

## Members

- [`new`](#function-new)
- [`can_write`](#function-can_write)
- [`links`](#function-links)
- [`sample_value_was_null`](#function-sample_value_was_null)
- [`value_type`](#function-value_type)
- [`try_create_text_selector`](#function-try_create_text_selector)
- [`read`](#function-read)
- [`read_as_string`](#function-read_as_string)
- [`read_as_boolean`](#function-read_as_boolean)
- [`read_as_nullable_boolean`](#function-read_as_nullable_boolean)
- [`write`](#function-write)
- [`dispose`](#function-dispose)

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

### new

```rust
fn new(binding: &Rc<dyn BindingBase>, sample_model: Option<&BoxedValue>) -> Rc<Self>
```

The accessor of `binding`; `sample_model` is a model of the items, whose value tells
whether the value can be null and, for a reflection binding, the type of the value.

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

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

### can_write

```rust
fn can_write(self: &Self) -> bool
```

Whether the binding writes values back to the model (`CanWrite`).

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

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

### links

```rust
fn links(self: &Self) -> Vec<ObjectLink>
```

The objects on the binding's path whose changes the column observes (`Links`): the model,
then the owner of each member read below it.

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

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

### sample_value_was_null

```rust
fn sample_value_was_null(self: &Self) -> bool
```

Whether the value of the sample model was null (`SampleValueWasNull`).

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

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

### value_type

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

The type of the value: the type the binding's path declares, or the type of the first value
read (`ValueType`).

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

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

### try_create_text_selector

```rust
fn try_create_text_selector(binding: Option<&Rc<dyn BindingBase>>) -> Option<Rc<dyn Fn(&BoxedValue) -> Option<String>>>
```

The selector of the text `binding` selects from a model, if there is a binding
(`TryCreateTextSelector`).

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

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

### read

```rust
fn read(self: &Self, model: &BoxedValue) -> Option<BoxedValue>
```

The value the binding selects from `model` (`Read`).

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

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

### read_as_string

```rust
fn read_as_string(self: &Self, model: &BoxedValue) -> Option<String>
```

The text of the value (`ReadAsString`: `ToString()` of the value).

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

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

### read_as_boolean

```rust
fn read_as_boolean(self: &Self, model: &BoxedValue) -> bool
```

The value as a boolean, false for null (`ReadAsBoolean`).

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

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

### read_as_nullable_boolean

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

The value as a nullable boolean (`ReadAsNullableBoolean`).

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

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

### write

```rust
fn write(self: &Self, model: &BoxedValue, value: Option<BoxedValue>)
```

Writes `value` to `model` through the binding, converted to the type of the value
(`Write`); nothing when the binding does not write back.

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

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

### dispose

```rust
fn dispose(self: &Self)
```

Ends the binding (`Dispose`).

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

## 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`
- `Drop`

## Availability

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