BindableArray
struct · ferroui-base · v0.5.0
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.
Members
new
fn new(items: impl IntoIterator<Item = T>) -> Rc<Self>
Creates a one-dimensional array.
with_lengths
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.
lengths
fn lengths(self: &Self) -> &[usize]
The length of each dimension.
len
fn len(self: &Self) -> usize
The total number of elements.
is_empty
fn is_empty(self: &Self) -> bool
get
fn get(self: &Self, indexes: &[usize]) -> T
The element at indexes. Panics if out of range.
set
fn set(self: &Self, indexes: &[usize], value: T)
Replaces the element at indexes. Panics if out of range.
to_vec
fn to_vec(self: &Self) -> Vec<T>
The elements in row-major order.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeAnyValueClassDefaultsBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyErasedDestructorIntoEitherPartialEqIBindableArrayIBindableIndexer
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.