# ListObservable

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-reactive/linq/struct-listobservable/

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

```rust
struct ListObservable<T>
```

The values of a sequence as a list, once the sequence has ended (`ListObservable<T>`), and the
sequence of its end.

The list subscribes to the source when it is made, and keeps its values; the list can then be
read and changed as a list once the source has completed.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Reactive/linq/to_list_observable.rs#L24)

## Members

- [`new`](#function-new)
- [`value`](#function-value)
- [`index_of`](#function-index_of)
- [`insert`](#function-insert)
- [`remove_at`](#function-remove_at)
- [`get`](#function-get)
- [`set`](#function-set)
- [`add`](#function-add)
- [`clear`](#function-clear)
- [`contains`](#function-contains)
- [`copy_to`](#function-copy_to)
- [`count`](#function-count)
- [`is_read_only`](#function-is_read_only)
- [`remove`](#function-remove)
- [`to_vec`](#function-to_vec)

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

### new

```rust
fn new(source: Rc<dyn IObservable<T>>) -> Rc<Self>
```

The list of the values of `source` (`ListObservable(IObservable<T>)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Reactive/linq/to_list_observable.rs#L32)

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

### value

```rust
fn value(self: &Self) -> Result<T, ObservableError>
where T: Clone
```

The last value (`Value`); an `Err` with `SequenceError::NoElements` when there is none.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Reactive/linq/to_list_observable.rs#L59)

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

### index_of

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

The index of the first value equal to `item` (`IndexOf`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Reactive/linq/to_list_observable.rs#L68)

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

### insert

```rust
fn insert(self: &Self, index: usize, item: T) -> Result<(), ObservableError>
```

Inserts `item` at `index` (`Insert`); an index beyond the count is an
`ArgumentOutOfRangeError`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Reactive/linq/to_list_observable.rs#L78)

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

### remove_at

```rust
fn remove_at(self: &Self, index: usize) -> Result<(), ObservableError>
```

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

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Reactive/linq/to_list_observable.rs#L87)

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

### get

```rust
fn get(self: &Self, index: usize) -> Result<T, ObservableError>
where T: Clone
```

The value at `index` (the getter of the indexer).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Reactive/linq/to_list_observable.rs#L96)

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

### set

```rust
fn set(self: &Self, index: usize, value: T) -> Result<(), ObservableError>
```

Replaces the value at `index` (the setter of the indexer).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Reactive/linq/to_list_observable.rs#L107)

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

### add

```rust
fn add(self: &Self, item: T) -> Result<(), ObservableError>
```

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

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Reactive/linq/to_list_observable.rs#L116)

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

### clear

```rust
fn clear(self: &Self) -> Result<(), ObservableError>
```

Removes every value (`Clear`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Reactive/linq/to_list_observable.rs#L123)

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

### contains

```rust
fn contains(self: &Self, item: &T) -> Result<bool, ObservableError>
where T: PartialEq
```

Whether a value equals `item` (`Contains`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Reactive/linq/to_list_observable.rs#L130)

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

### copy_to

```rust
fn copy_to(self: &Self, array: &mut [T], array_index: usize) -> Result<(), ObservableError>
where T: Clone
```

Copies the values into `array` from `array_index` on (`CopyTo`); an array too short is an
`ArgumentOutOfRangeError`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Reactive/linq/to_list_observable.rs#L140)

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

### count

```rust
fn count(self: &Self) -> Result<usize, ObservableError>
```

The count of the values (`Count`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Reactive/linq/to_list_observable.rs#L154)

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

### is_read_only

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

Whether the list cannot be changed (`IsReadOnly`): it can.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Reactive/linq/to_list_observable.rs#L160)

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

### remove

```rust
fn remove(self: &Self, item: &T) -> Result<bool, ObservableError>
where T: PartialEq
```

Removes the first value equal to `item` (`Remove`); whether there was one.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Reactive/linq/to_list_observable.rs#L165)

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

### to_vec

```rust
fn to_vec(self: &Self) -> Result<Vec<T>, ObservableError>
where T: Clone
```

The values, in order (`GetEnumerator`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Reactive/linq/to_list_observable.rs#L181)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- [`SubscribeGuard<T>`](/docs/0.5.0/api/ferroui-base/reactive/use-subscribeguard/)
- [`IObservable<()>`](/docs/0.5.0/api/ferroui-base/reactive/use-iobservable/)

## Availability

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