Trait bevy_reflect::Array
source · pub trait Array: Reflect {
fn get(&self, index: usize) -> Option<&dyn Reflect>;
fn get_mut(&mut self, index: usize) -> Option<&mut dyn Reflect>;
fn len(&self) -> usize;
fn iter(&self) -> ArrayIter<'_> ⓘ;
fn drain(self: Box<Self>) -> Vec<Box<dyn Reflect>>;
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§
sourcefn get(&self, index: usize) -> Option<&dyn Reflect>
fn get(&self, index: usize) -> Option<&dyn Reflect>
Returns a reference to the element at index
, or None
if out of bounds.