FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    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.

    View source

    Members

    new

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

    Creates a one-dimensional array.

    Source

    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.

    Source

    lengths

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

    The length of each dimension.

    Source

    len

    fn len(self: &Self) -> usize
    

    The total number of elements.

    Source

    is_empty

    fn is_empty(self: &Self) -> bool
    

    Source

    get

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

    The element at indexes. Panics if out of range.

    Source

    set

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

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

    Source

    to_vec

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

    The elements in row-major order.

    Source

    Trait implementations

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.