# ChangeSetBinder

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-reactiveui/change_sets/struct-changesetbinder/

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

```rust
struct ChangeSetBinder<T>
```

Applies a stream of change sets to a list that it keeps (`ChangeSetBinder<T>`): the light
replacement of DynamicData's `SourceList` bind that the list adapters of the platforms use. It
subscribes once, applies each change in order, tells the adapter of each change and of each
batch, so that the adapter raises its own notifications, and unsubscribes when disposed.

Deviation (DEVIATIONS.md, ReactiveUI): upstream's class is internal to the platform assemblies;
it is public here for the integration of the user interface, which lives in its own crate.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/change_sets/change_set_binder.rs#L19)

## Members

- [`new`](#function-new)
- [`count`](#function-count)
- [`get`](#function-get)
- [`to_vec`](#function-to_vec)
- [`dispose`](#function-dispose)

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

### new

```rust
fn new(source: Rc<dyn IObservable<ReactiveChangeSet<T>>>, on_change: Option<ReactiveChangeHandler<T>>, on_batch: Option<Rc<dyn Fn() -> ()>>) -> Self
```

A binder of `source` (`ChangeSetBinder(IObservable<IReactiveChangeSet<T>>,
ReactiveChangeHandler<T>?, Action?)`): `on_change` is told of each change as it is applied,
and `on_batch` once after each change set.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/change_sets/change_set_binder.rs#L28)

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

### count

```rust
fn count(self: &Self) -> usize
```

The number of items (`Count`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/change_sets/change_set_binder.rs#L55)

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

### get

```rust
fn get(self: &Self, index: usize) -> T
```

The item at `index` (the indexer).
## Panics
When `index` is out of range (`ArgumentOutOfRangeException`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/change_sets/change_set_binder.rs#L63)

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

### to_vec

```rust
fn to_vec(self: &Self) -> Vec<T>
```

A copy of the items.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/change_sets/change_set_binder.rs#L68)

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

### dispose

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

Unsubscribes from the change sets (`Dispose`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/change_sets/change_set_binder.rs#L73)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- [`IDisposable`](/docs/0.5.0/api/ferroui-base/reactive/use-idisposable/)

## Availability

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