pub struct Il2cppArray<T> {
pub klass: *mut c_void,
pub monitor: *mut c_void,
pub bounds: *mut ArrayBounds,
pub max_length: usize,
/* private fields */
}Fields§
§klass: *mut c_voidPointer to the array class
monitor: *mut c_voidMonitor for synchronization
bounds: *mut ArrayBoundsPointer to array bounds
max_length: usizeMaximum length of the array
Implementations§
Source§impl<T: Copy> Il2cppArray<T>
impl<T: Copy> Il2cppArray<T>
Sourcepub fn get_pointer(&self) -> *const T
pub fn get_pointer(&self) -> *const T
Sourcepub fn insert(&mut self, arr: &[T], size: usize, index: usize)
pub fn insert(&mut self, arr: &[T], size: usize, index: usize)
Inserts elements from a slice into the array
§Arguments
arr- The slice of elements to insertsize- The number of elements to insertindex- The starting index in the array
Sourcepub fn remove_at(&mut self, index: usize)
pub fn remove_at(&mut self, index: usize)
Removes an element at the specified index
Shifts subsequent elements to the left in place.
IL2CPP arrays are fixed-size, so this does not change max_length.
The final slot is left as a duplicate of the former tail element.
§Arguments
index- The index of the element to remove
Sourcepub fn remove_range(&mut self, index: usize, count: usize)
pub fn remove_range(&mut self, index: usize, count: usize)
Removes a range of elements
Shifts subsequent elements to the left in place.
IL2CPP arrays are fixed-size, so this does not change max_length.
Vacated tail slots are left duplicated from the previous tail values.
§Arguments
index- The starting indexcount- The number of elements to remove
Sourcepub fn remove_all(&mut self)
pub fn remove_all(&mut self)
Removes all elements from the array
IL2CPP arrays are fixed-size managed objects, so clearing them by shrinking the header is unsupported. Overwrite elements explicitly if you need sentinel values.