# IItemsList

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-controls/trait-iitemslist/

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

```rust
trait IItemsList
```

An untyped, indexable list of items that may notify of changes.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/items_source.rs#L454)

## Members

- [`key_index_mapping`](#function-key_index_mapping)
- [`count`](#function-count)
- [`get_at`](#function-get_at)
- [`index_of`](#function-index_of)
- [`is_notifying`](#function-is_notifying)
- [`add_collection_changed`](#function-add_collection_changed)
- [`remove_collection_changed`](#function-remove_collection_changed)
- [`identity`](#function-identity)
- [`as_any`](#function-as_any)

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

### key_index_mapping

```rust
fn key_index_mapping(self: &Self) -> Option<&dyn crate::IKeyIndexMapping>
```

The unique keys of the items, if the list provides them
(`IKeyIndexMapping`); `None` by default. An index is
never a key: a list without keys has none.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/items_source.rs#L458)

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

### count

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

The number of items.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/items_source.rs#L463)

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

### get_at

```rust
fn get_at(self: &Self, index: usize) -> Option<BoxedValue>
```

The item at `index`. Panics if out of range.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/items_source.rs#L466)

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

### index_of

```rust
fn index_of(self: &Self, item: &Option<BoxedValue>) -> i32
```

The index of the first item equal to `item`, or `-1`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/items_source.rs#L469)

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

### is_notifying

```rust
fn is_notifying(self: &Self) -> bool
```

Whether the list notifies of changes.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/items_source.rs#L479)

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

### add_collection_changed

```rust
fn add_collection_changed(self: &Self, _handler: Rc<ItemsChangedHandler>) -> Option<u64>
```

Subscribes to changes. Returns the token for
`remove_collection_changed`, or
`None` if the list does not notify.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/items_source.rs#L486)

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

### remove_collection_changed

```rust
fn remove_collection_changed(self: &Self, _token: u64)
```

Unsubscribes a handler.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/items_source.rs#L491)

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

### identity

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

The identity of the collection, for a list that is a handle to a collection
(a `FerroList`): two handles to one collection are the same collection. `None`
for a list that is the collection itself, whose identity is its address.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/items_source.rs#L496)

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

### as_any

```rust
fn as_any(self: &Self) -> &dyn Any
```

The collection as `Any`, to get back to the typed collection.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/items_source.rs#L501)

## Trait implementations

- [`IItemsList`](/docs/0.5.0/api/ferroui-controls/trait-iitemslist/)

## Availability

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