# ReactiveChange

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

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

```rust
struct ReactiveChange<T>
```

One change of a collection (`ReactiveChange<T>`): the reason, the item, and where they apply
the previous item and the indexes.

The indexes are `-1` when they are not known, as in `NotifyCollectionChangedEventArgs`.

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

## Members

- [`new`](#function-new)
- [`reason`](#function-reason)
- [`current`](#function-current)
- [`previous`](#function-previous)
- [`current_index`](#function-current_index)
- [`previous_index`](#function-previous_index)

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

### new

```rust
fn new(reason: ReactiveChangeReason, current: T, previous: Option<T>, current_index: i32, previous_index: i32) -> Self
```

A change (`ReactiveChange(ReactiveChangeReason, T, T?, int, int)`): `previous` is the
replaced item of a `Replace`, and `previous_index` the
former index of a `Move`.

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

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

### reason

```rust
fn reason(self: &Self) -> ReactiveChangeReason
```

Why the change happened (`Reason`).

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

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

### current

```rust
fn current(self: &Self) -> &T
```

The item added, replacing, moved or refreshed (`Current`).

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

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

### previous

```rust
fn previous(self: &Self) -> Option<&T>
```

The replaced item of a `Replace` (`Previous`).

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

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

### current_index

```rust
fn current_index(self: &Self) -> i32
```

The index of the item, or `-1` when it is not known (`CurrentIndex`).

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

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

### previous_index

```rust
fn previous_index(self: &Self) -> i32
```

The former index of a `Move`, or `-1` (`PreviousIndex`).

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

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- `Clone`
- `Debug`
- `StructuralPartialEq`
- `PartialEq`
- `Eq`
- `Hash`

## Availability

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