# IIndexAware

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-dynamic-data/binding/trait-iindexaware/

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

```rust
trait IIndexAware
```

An item that knows its index in a sorted collection (`IIndexAware`), which `UpdateIndex` sets.

Deviation (DEVIATIONS.md, DynamicData): the setter takes `&self`, as the items are shared
(`Rc`) and keep the index in a `Cell`; the index is a `usize`.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.DynamicData/binding/i_index_aware.rs#L9)

## Members

- [`index`](#function-index)
- [`set_index`](#function-set_index)

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

### index

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

The index (`Index`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.DynamicData/binding/i_index_aware.rs#L11)

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

### set_index

```rust
fn set_index(self: &Self, index: usize)
```

Sets the index (`Index`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.DynamicData/binding/i_index_aware.rs#L13)

## Trait implementations

- [`IIndexAware`](/docs/0.5.0/api/ferroui-dynamic-data/binding/trait-iindexaware/)

## Availability

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