# BindableArray

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/data/model/struct-bindablearray/

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

```rust
struct BindableArray<T: PropertyValue>
```

An array that bindings can index into: one or more dimensions of fixed
lengths, stored in row-major order.

As a model object it has identity equality.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/model/i_bindable_indexer.rs#L83)

## Members

- [`new`](#function-new)
- [`with_lengths`](#function-with_lengths)
- [`lengths`](#function-lengths)
- [`len`](#function-len)
- [`is_empty`](#function-is_empty)
- [`get`](#function-get)
- [`set`](#function-set)
- [`to_vec`](#function-to_vec)

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

### new

```rust
fn new(items: impl IntoIterator<Item = T>) -> Rc<Self>
```

Creates a one-dimensional array.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/model/i_bindable_indexer.rs#L90)

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

### with_lengths

```rust
fn with_lengths(lengths: &[usize], items: impl IntoIterator<Item = T>) -> Rc<Self>
```

Creates an array with the given length of each dimension, from its
elements in row-major order. Panics if the number of elements is not
the product of the lengths.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/model/i_bindable_indexer.rs#L99)

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

### lengths

```rust
fn lengths(self: &Self) -> &[usize]
```

The length of each dimension.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/model/i_bindable_indexer.rs#L115)

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

### len

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

The total number of elements.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/model/i_bindable_indexer.rs#L120)

<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.Base/data/model/i_bindable_indexer.rs#L124)

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

### get

```rust
fn get(self: &Self, indexes: &[usize]) -> T
```

The element at `indexes`. Panics if out of range.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/model/i_bindable_indexer.rs#L129)

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

### set

```rust
fn set(self: &Self, indexes: &[usize], value: T)
```

Replaces the element at `indexes`. Panics if out of range.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/model/i_bindable_indexer.rs#L135)

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

### to_vec

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

The elements in row-major order.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/model/i_bindable_indexer.rs#L141)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`AnyValue`](/docs/0.5.0/api/ferroui-base/trait-anyvalue/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ErasedDestructor`
- `IntoEither`
- `PartialEq`
- [`IBindableArray`](/docs/0.5.0/api/ferroui-base/data/model/trait-ibindablearray/)
- [`IBindableIndexer`](/docs/0.5.0/api/ferroui-base/data/model/trait-ibindableindexer/)

## Availability

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