# ItemWithIndex

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

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

```rust
struct ItemWithIndex<T>
```

An item and its index (`ItemWithIndex<T>`): equal and hashed by the item alone, as upstream's.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.DynamicData/kernel/item_with_index.rs#L8)

## Members

- [`new`](#function-new)
- [`item`](#function-item)
- [`index`](#function-index)
- [`into_parts`](#function-into_parts)

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

### new

```rust
fn new(item: T, index: usize) -> Self
```

The pair (`ItemWithIndex(T, int)`).

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

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

### item

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

The item (`Item`).

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

<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/kernel/item_with_index.rs#L25)

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

### into_parts

```rust
fn into_parts(self: Self) -> (T, usize)
```

The item and the index.

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

## Trait implementations

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

## Availability

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