# ChartCollection

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

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

```rust
struct ChartCollection<T: ObjectType>
```

An observable collection with transactional ownership checks. Its storage is
shared by handles; snapshots remain valid during reentrant notifications.

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

## Members

- [`count`](#function-count)
- [`is_empty`](#function-is_empty)
- [`snapshot`](#function-snapshot)
- [`get`](#function-get)
- [`contains`](#function-contains)
- [`index_of`](#function-index_of)
- [`add`](#function-add)
- [`insert`](#function-insert)
- [`set`](#function-set)
- [`remove_at`](#function-remove_at)
- [`remove`](#function-remove)
- [`clear`](#function-clear)
- [`add_collection_changed`](#function-add_collection_changed)
- [`remove_collection_changed`](#function-remove_collection_changed)

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

### count

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Charts/chart_collection.rs#L112)

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

### is_empty

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Charts/chart_collection.rs#L115)

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

### snapshot

```rust
fn snapshot(self: &Self) -> Rc<Vec<Ref<T>>>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Charts/chart_collection.rs#L118)

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

### get

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Charts/chart_collection.rs#L121)

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

### contains

```rust
fn contains(self: &Self, value: impl IntoRef<T>) -> bool
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Charts/chart_collection.rs#L127)

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

### index_of

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Charts/chart_collection.rs#L130)

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

### add

```rust
fn add(self: &Self, value: impl IntoRef<T>) -> Result<(), ChartError>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Charts/chart_collection.rs#L166)

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

### insert

```rust
fn insert(self: &Self, index: usize, value: impl IntoRef<T>) -> Result<(), ChartError>
```



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

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

### set

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Charts/chart_collection.rs#L182)

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

### remove_at

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Charts/chart_collection.rs#L195)

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

### remove

```rust
fn remove(self: &Self, value: impl IntoRef<T>) -> bool
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Charts/chart_collection.rs#L202)

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

### clear

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Charts/chart_collection.rs#L209)

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

### add_collection_changed

```rust
fn add_collection_changed(self: &Self, handler: Rc<CollectionChangedHandler<Ref<T>>>) -> u64
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Charts/chart_collection.rs#L223)

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

### remove_collection_changed

```rust
fn remove_collection_changed(self: &Self, token: u64) -> bool
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Charts/chart_collection.rs#L226)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- [`PropertyValue`](/docs/0.5.0/api/ferroui-base/trait-propertyvalue/)
- [`AnyValue`](/docs/0.5.0/api/ferroui-base/trait-anyvalue/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- `Clone`
- `PartialEq`

## Availability

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