pub struct UeArray<T: ContainerElement> { /* private fields */ }Expand description
A view into a UE TArray<T> property on a UObject.
This is a lightweight Copy handle — it does not own the data.
All operations go through FFI calls to the C++ container API.
Implementations§
Source§impl<T: ContainerElement> UeArray<T>
impl<T: ContainerElement> UeArray<T>
Sourcepub fn new(owner: UObjectHandle, prop: FPropertyHandle) -> Self
pub fn new(owner: UObjectHandle, prop: FPropertyHandle) -> Self
Create a new array view from an owner object handle and a property handle.
Sourcepub fn len(&self) -> UikaResult<usize>
pub fn len(&self) -> UikaResult<usize>
Returns the number of elements in the array.
Sourcepub fn is_empty(&self) -> UikaResult<bool>
pub fn is_empty(&self) -> UikaResult<bool>
Returns true if the array is empty.
Sourcepub fn get(&self, index: usize) -> UikaResult<T>
pub fn get(&self, index: usize) -> UikaResult<T>
Get the element at index.
Sourcepub fn push(&self, val: &T) -> UikaResult<()>
pub fn push(&self, val: &T) -> UikaResult<()>
Append an element to the end of the array.
Sourcepub fn remove(&self, index: usize) -> UikaResult<()>
pub fn remove(&self, index: usize) -> UikaResult<()>
Remove the element at index, shifting subsequent elements down.
Sourcepub fn clear(&self) -> UikaResult<()>
pub fn clear(&self) -> UikaResult<()>
Remove all elements from the array.
Sourcepub fn iter(&self) -> UeArrayIter<'_, T> ⓘ
pub fn iter(&self) -> UeArrayIter<'_, T> ⓘ
Returns an iterator over the elements.
Source§impl<T: ContainerElement> UeArray<T>
impl<T: ContainerElement> UeArray<T>
Sourcepub fn to_vec(&self) -> UikaResult<Vec<T>>
pub fn to_vec(&self) -> UikaResult<Vec<T>>
Bulk-copy all elements to a Vec<T> in a single FFI call.
Sourcepub fn bulk_iter(&self) -> UikaResult<BulkArrayIter<T>>
pub fn bulk_iter(&self) -> UikaResult<BulkArrayIter<T>>
Bulk-fetch all elements as a lazy iterator (single FFI call).
Sourcepub fn set_all(&self, items: &[T]) -> UikaResult<()>
pub fn set_all(&self, items: &[T]) -> UikaResult<()>
Replace all array elements from a slice in a single FFI call.
Trait Implementations§
Source§impl<'a, T: ContainerElement> IntoIterator for &'a UeArray<T>
impl<'a, T: ContainerElement> IntoIterator for &'a UeArray<T>
impl<T: Copy + ContainerElement> Copy for UeArray<T>
Auto Trait Implementations§
impl<T> Freeze for UeArray<T>
impl<T> RefUnwindSafe for UeArray<T>where
T: RefUnwindSafe,
impl<T> Send for UeArray<T>where
T: Send,
impl<T> Sync for UeArray<T>where
T: Sync,
impl<T> Unpin for UeArray<T>where
T: Unpin,
impl<T> UnsafeUnpin for UeArray<T>
impl<T> UnwindSafe for UeArray<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more