Trait bevy::reflect::Array

pub trait Array: Reflect {
    fn get(&self, index: usize) -> Option<&(dyn Reflect + 'static)>;
    fn get_mut(&mut self, index: usize) -> Option<&mut (dyn Reflect + 'static)>;
    fn len(&self) -> usize;
    fn iter(&self) -> ArrayIter<'_> ;
    fn drain(
        self: Box<Self, Global>
    ) -> Vec<Box<dyn Reflect + 'static, Global>, Global> ; fn is_empty(&self) -> bool { ... } fn clone_dynamic(&self) -> DynamicArray { ... } }
Expand description

A static-sized array of Reflect items.

This corresponds to types like [T; N] (arrays).

Currently, this only supports arrays of up to 32 items. It can technically contain more than 32, but the blanket GetTypeRegistration is only implemented up to the 32 item limit due to a limitation on Deserialize.

Required Methods§

Returns a reference to the element at index, or None if out of bounds.

Returns a mutable reference to the element at index, or None if out of bounds.

Returns the number of elements in the collection.

Returns an iterator over the collection.

Drain the elements of this array to get a vector of owned values.

Provided Methods§

Returns true if the collection contains no elements.

Implementations on Foreign Types§

Implementors§