# ICellBinding

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

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

```rust
trait ICellBinding<T: 'static>
```

The binding of a cell to its value (`ISubject<BindingValue<T>>`): an observable of the value
that the cell writes back to.

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

## Members

- [`subscribe`](#function-subscribe)
- [`unsubscribe`](#function-unsubscribe)
- [`on_next`](#function-on_next)
- [`can_write`](#function-can_write)
- [`as_retargetable`](#function-as_retargetable)

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

### subscribe

```rust
fn subscribe(self: &Self, observer: Rc<dyn Fn(T) -> ()>) -> u64
```

Subscribes `observer`: it receives the current value now, if there is one, and every later
value (`Subscribe`). Returns the token of `unsubscribe`. An observer
receives a value of its own, which it keeps without copying it.

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

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

### unsubscribe

```rust
fn unsubscribe(self: &Self, token: u64)
```

Ends a subscription (the `IDisposable` that `Subscribe` returns).

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

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

### on_next

```rust
fn on_next(self: &Self, value: T)
```

Writes a value to the source (`OnNext`).

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

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

### can_write

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

Whether the binding writes its values back (`Write is not null`).

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

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

### as_retargetable

```rust
fn as_retargetable(self: &Self) -> Option<&dyn IRetargetableCellBinding>
```

The binding as one whose root can be replaced (`is IRetargetableTypedBindingExpression`).

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

## Trait implementations

- [`ICellBinding<V>`](/docs/0.5.0/api/ferroui-controls-treedatagrid/models/trait-icellbinding/)

## Availability

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