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<'_>ⓘNotable traits for ArrayIter<'a>impl<'a> Iterator for ArrayIter<'a> type Item = &'a (dyn Reflect + 'static);
;
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.