pub struct UeArray<T>where
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> UeArray<T>where
T: ContainerElement,
impl<T> UeArray<T>where
T: ContainerElement,
Sourcepub fn new(owner: UObjectHandle, prop: FPropertyHandle) -> UeArray<T>
pub fn new(owner: UObjectHandle, prop: FPropertyHandle) -> UeArray<T>
Create a new array view from an owner object handle and a property handle.
Sourcepub fn len(&self) -> Result<usize, RustealError>
pub fn len(&self) -> Result<usize, RustealError>
Returns the number of elements in the array.
Sourcepub fn is_empty(&self) -> Result<bool, RustealError>
pub fn is_empty(&self) -> Result<bool, RustealError>
Returns true if the array is empty.
Sourcepub fn get(&self, index: usize) -> Result<T, RustealError>
pub fn get(&self, index: usize) -> Result<T, RustealError>
Get the element at index.
Sourcepub fn push(&self, val: &T) -> Result<(), RustealError>
pub fn push(&self, val: &T) -> Result<(), RustealError>
Append an element to the end of the array.
Sourcepub fn remove(&self, index: usize) -> Result<(), RustealError>
pub fn remove(&self, index: usize) -> Result<(), RustealError>
Remove the element at index, shifting subsequent elements down.
Sourcepub fn clear(&self) -> Result<(), RustealError>
pub fn clear(&self) -> Result<(), RustealError>
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> UeArray<T>where
T: ContainerElement,
impl<T> UeArray<T>where
T: ContainerElement,
Sourcepub fn to_vec(&self) -> Result<Vec<T>, RustealError>
pub fn to_vec(&self) -> Result<Vec<T>, RustealError>
Bulk-copy all elements to a Vec<T> in a single FFI call.
Sourcepub fn bulk_iter(&self) -> Result<BulkArrayIter<T>, RustealError>
pub fn bulk_iter(&self) -> Result<BulkArrayIter<T>, RustealError>
Bulk-fetch all elements as a lazy iterator (single FFI call).
Trait Implementations§
impl<T> Copy for UeArray<T>where
T: Copy + ContainerElement,
Source§impl<'a, T> IntoIterator for &'a UeArray<T>where
T: ContainerElement,
impl<'a, T> IntoIterator for &'a UeArray<T>where
T: ContainerElement,
Auto Trait Implementations§
impl<T> Freeze for UeArray<T>where
PhantomData<T>: Freeze,
impl<T> RefUnwindSafe for UeArray<T>where
PhantomData<T>: RefUnwindSafe,
impl<T> Send for UeArray<T>where
PhantomData<T>: Send,
impl<T> Sync for UeArray<T>where
PhantomData<T>: Sync,
impl<T> Unpin for UeArray<T>where
PhantomData<T>: Unpin,
impl<T> UnsafeUnpin for UeArray<T>where
PhantomData<T>: UnsafeUnpin,
impl<T> UnwindSafe for UeArray<T>where
PhantomData<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