# ItemChange

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-dynamic-data/list/struct-itemchange/

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

```rust
struct ItemChange<T>
```

The change of one item of a list (`ItemChange<T>`).

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.DynamicData/list/item_change.rs#L5)

## 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: super::ListChangeReason, current: T, previous: Option<T>, current_index: Option<usize>, previous_index: Option<usize>) -> Self
```

`ItemChange(ListChangeReason, T, in Optional<T>, int, int)`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.DynamicData/list/item_change.rs#L15)

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

### reason

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

The reason (`Reason`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.DynamicData/list/item_change.rs#L20)

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

### current

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

The item (`Current`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.DynamicData/list/item_change.rs#L25)

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

### previous

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

The item that was replaced (`Previous`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.DynamicData/list/item_change.rs#L30)

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

### current_index

```rust
fn current_index(self: &Self) -> Option<usize>
```

The index of the item (`CurrentIndex`; `-1` upstream when none).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.DynamicData/list/item_change.rs#L35)

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

### previous_index

```rust
fn previous_index(self: &Self) -> Option<usize>
```

The previous index of a moved item (`PreviousIndex`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.DynamicData/list/item_change.rs#L40)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- `Equivalent<K>`
- `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/).
