# IList

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

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

```rust
trait IList<T: Clone + PartialEq>
```

A list that the changes of a list can be applied to (`System.Collections.Generic.IList<T>`,
with the forms of `ListEx` as provided methods).

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

## Members

- [`count`](#function-count)
- [`get`](#function-get)
- [`set`](#function-set)
- [`insert`](#function-insert)
- [`remove_at`](#function-remove_at)
- [`clear`](#function-clear)
- [`add`](#function-add)
- [`index_of`](#function-index_of)
- [`index_of_with`](#function-index_of_with)
- [`remove`](#function-remove)
- [`add_range`](#function-add_range)
- [`add_or_insert_range`](#function-add_or_insert_range)
- [`remove_range`](#function-remove_range)
- [`supports_ranges`](#function-supports_ranges)
- [`move_item`](#function-move_item)
- [`refresh_at`](#function-refresh_at)

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

### count

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

The number of items (`Count`).

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

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

### get

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

The item at `index` (the indexer's getter).

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

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

### set

```rust
fn set(self: &mut Self, index: usize, item: T)
```

Replaces the item at `index` (the indexer's setter).

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

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

### insert

```rust
fn insert(self: &mut Self, index: usize, item: T)
```

Inserts an item (`Insert`).

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

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

### remove_at

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

Removes the item at `index` (`RemoveAt`).

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

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

### clear

```rust
fn clear(self: &mut Self)
```

Removes every item (`Clear`).

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

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

### add

```rust
fn add(self: &mut Self, item: T)
```

Adds an item at the end (`Add`).

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

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

### index_of

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

The index of `item` (`IndexOf`).

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

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

### index_of_with

```rust
fn index_of_with(self: &Self, item: &T, comparer: &dyn Fn(&T, &T) -> bool) -> Option<usize>
```

The index of `item` by `comparer` (`ListEx.IndexOf(IEnumerable, T, IEqualityComparer)`).

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

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

### remove

```rust
fn remove(self: &mut Self, item: &T) -> bool
```

Removes `item`; false when it is not in the list (`Remove`).

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

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

### add_range

```rust
fn add_range(self: &mut Self, items: Vec<T>)
```

Adds the items at the end (`ListEx.AddRange`): one by one unless the list adds ranges.

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

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

### add_or_insert_range

```rust
fn add_or_insert_range(self: &mut Self, items: Vec<T>, index: Option<usize>)
```

Inserts the items at `index`, or adds them without an index (`ListEx.AddOrInsertRange`): in
reverse order at the index unless the list inserts ranges, as upstream does.

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

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

### remove_range

```rust
fn remove_range(self: &mut Self, _index: usize, _count: usize)
```

Removes `count` items from `index` (`ListEx.RemoveRange`).
## Panics
For a list without ranges (`NotSupportedException`).

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

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

### supports_ranges

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

Whether the list removes ranges at once (`List<T>` or `IExtendedList<T>`).

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

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

### move_item

```rust
fn move_item(self: &mut Self, original: usize, destination: usize)
```

Moves the item at `original` to `destination` (the `Moved` case of `ListEx.Clone`).

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

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

### refresh_at

```rust
fn refresh_at(self: &mut Self, index: usize, item: T)
```

Reports a refresh of the item at `index` (the `Refresh` case of `ListEx.Clone`): the item is
removed and inserted again unless the list reports refreshes.

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

## Trait implementations

- [`IList<T>`](/docs/0.5.0/api/ferroui-dynamic-data/list/trait-ilist/)

## Availability

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