# Samples

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

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

```rust
struct Samples
```

One dimension's values. The same instance can be shared by multiple series.

`ItemsSource` preserves arbitrary boxed values. Supported collections use the
existing FerroUI adapters, including live `Rc<FerroList<T>>`; unsupported
objects produce an empty view. Source changes invalidate a lazily decoded
snapshot. No chart owns a Samples object, and change subscriptions capture
only weak references.

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

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`items_source_property`](#function-items_source_property)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`from_values`](#function-from_values)
- [`from_source`](#function-from_source)
- [`items_source`](#function-items_source)
- [`set_items_source`](#function-set_items_source)
- [`set_source`](#function-set_source)
- [`source`](#function-source)
- [`view`](#function-view)
- [`count`](#function-count)
- [`is_empty`](#function-is_empty)
- [`get_at`](#function-get_at)
- [`value_at`](#function-value_at)
- [`snapshot`](#function-snapshot)
- [`revision`](#function-revision)
- [`add_changed`](#function-add_changed)
- [`remove_changed`](#function-remove_changed)

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

### TYPE

```rust
const TYPE: &'static $crate::TypeInfo
```

The runtime type of this class.

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

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

### to_ref

```rust
fn to_ref(self: &Self) -> $crate::Ref<Samples>
```

Returns a strong reference to this object.

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

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

### items_source_property

```rust
fn items_source_property() -> &'static StyledProperty<Option<BoxedValue>>
```

The underlying, optionally observable FerroUI item source.

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

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

### construct

```rust
fn construct() -> Self
```



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

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

### new

```rust
fn new() -> Ref<Self>
```



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

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

### from_values

```rust
fn from_values<T: PropertyValue>(values: impl IntoIterator<Item = T>) -> Ref<Self>
```



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

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

### from_source

```rust
fn from_source(source: ItemsSource) -> Ref<Self>
```



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

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

### items_source

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

The original source object, including unsupported values. Unsupported
scalar objects remain readable here and produce an empty chart view.

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

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

### set_items_source

```rust
fn set_items_source(self: &Self, source: Option<BoxedValue>)
```



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

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

### set_source

```rust
fn set_source(self: &Self, source: Option<ItemsSource>)
```

Assign an existing FerroUI collection adapter without boxing it at the call site.

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

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

### source

```rust
fn source(self: &Self) -> Option<ItemsSource>
```

Resolve the source through FerroUI's normal collection conversions. This
also permits model collection types registered with
`ItemsSource::register_binding_conversion` to be used in bindings.

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

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

### view

```rust
fn view(self: &Self) -> Rc<ItemsSourceView>
```

Standard FerroUI view of the current source.

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

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

### count

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



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

<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/samples.rs#L150)

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

### get_at

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

Raw source item; `None` for an out-of-range index or a null item.

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

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

### value_at

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

Decoded item. Unsupported/null values remain gaps rather than shifting indexes.

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

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

### snapshot

```rust
fn snapshot(self: &Self) -> Rc<[Option<SampleValue>]>
```

A shared snapshot, decoded once per revision and reused by every consumer.

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

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

### revision

```rust
fn revision(self: &Self) -> u64
```



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

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

### add_changed

```rust
fn add_changed(self: &Self, handler: Rc<dyn Fn() -> ()>) -> u64
```

Observe both source replacement and changes within a notifying source.

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

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

### remove_changed

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



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

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- [`Receiver`](/docs/0.5.0/api/ferroui-system/task/oneshot/struct-receiver/)
- `Any`
- [`FerroObjectImplExt`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimplext/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- `Deref`
- [`Upcast<T>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`Upcast<Samples>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`StaticType`](/docs/0.5.0/api/ferroui-base/trait-statictype/)
- [`ObjectType`](/docs/0.5.0/api/ferroui-base/trait-objecttype/)
- [`Subclassable<T>`](/docs/0.5.0/api/ferroui-base/trait-subclassable/)
- [`DefaultConstructible`](/docs/0.5.0/api/ferroui-base/trait-defaultconstructible/)
- [`FerroObjectImpl`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimpl/)
- `Drop`

## Availability

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