# ItemsView

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-controls/struct-itemsview/

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

```rust
struct ItemsView<'a>
```

The items carried by a change notification of an untyped items list: a
cheap, copyable view that produces an item only when asked for it.

See the module documentation ("Change notifications").

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

## Members

- [`EMPTY`](#assoc_const-empty)
- [`from_slice`](#function-from_slice)
- [`window`](#function-window)
- [`of_source`](#function-of_source)
- [`of_source_range`](#function-of_source_range)
- [`from_typed`](#function-from_typed)
- [`len`](#function-len)
- [`is_empty`](#function-is_empty)
- [`get`](#function-get)
- [`iter`](#function-iter)
- [`to_vec`](#function-to_vec)

<a id="assoc_const-empty"></a>

### EMPTY

```rust
const EMPTY: ItemsView<'static>
```

A view of no items.

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

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

### from_slice

```rust
const fn from_slice(items: &'a [Option<BoxedValue>]) -> Self
```

A view of existing untyped items.

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

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

### window

```rust
fn window(list: &'a dyn IItemsList, start: usize, count: usize) -> Self
```

A view of `count` items of `list` starting at `start`. Nothing is
read from the list until an item is asked for.

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

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

### of_source

```rust
fn of_source(source: &'a ItemsSource) -> Self
```

A view of all the items of `source`. Only the count is read.

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

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

### of_source_range

```rust
fn of_source_range(source: &'a ItemsSource, start: usize, count: usize) -> Self
```

A view of `count` items of `source` starting at `start`.

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

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

### from_typed

```rust
fn from_typed<T: PropertyValue>(items: &'a TypedItems<'a, T>) -> Self
```

A view of typed items, each boxed when it is read.

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

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

### len

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

The number of items. Never reads an item.

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

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

### is_empty

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

Whether the view has no items. Never reads an item.

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

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

### get

```rust
fn get(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#L157)

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

### iter

```rust
fn iter(self: &Self) -> ItemsViewIter<'a>
```

The items, each read when the iterator reaches it.

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

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

### to_vec

```rust
fn to_vec(self: &Self) -> Vec<Option<BoxedValue>>
```

A copy of the items. Reads every item.

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

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- `Clone`
- `Copy`
- `Default`
- `Debug`
- `From<&'a [Option<Rc<dyn AnyValue>>]>`
- `From<&'a Vec<Option<Rc<dyn AnyValue>>>>`
- `From<&'a [Option<Rc<dyn AnyValue>>; N]>`
- `From<&'a ItemsSource>`
- `IntoIterator`

## Availability

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