pub struct UeMap<K: ContainerElement, V: ContainerElement> { /* private fields */ }Expand description
A view into a UE TMap<K, V> property on a UObject.
Implementations§
Source§impl<K: ContainerElement, V: ContainerElement> UeMap<K, V>
impl<K: ContainerElement, V: ContainerElement> UeMap<K, V>
pub fn new(owner: UObjectHandle, prop: FPropertyHandle) -> Self
Sourcepub fn len(&self) -> UikaResult<usize>
pub fn len(&self) -> UikaResult<usize>
Returns the number of key-value pairs in the map.
pub fn is_empty(&self) -> UikaResult<bool>
Sourcepub fn find(&self, key: &K) -> UikaResult<V>
pub fn find(&self, key: &K) -> UikaResult<V>
Look up a value by key. Returns Err(PropertyNotFound) if the key
is not in the map.
Sourcepub fn remove(&self, key: &K) -> UikaResult<()>
pub fn remove(&self, key: &K) -> UikaResult<()>
Remove a key from the map.
Sourcepub fn clear(&self) -> UikaResult<()>
pub fn clear(&self) -> UikaResult<()>
Remove all key-value pairs.
Sourcepub fn get_pair(&self, logical_index: usize) -> UikaResult<(K, V)>
pub fn get_pair(&self, logical_index: usize) -> UikaResult<(K, V)>
Get the key-value pair at logical index (for iteration).
Source§impl<K: ContainerElement, V: ContainerElement> UeMap<K, V>
impl<K: ContainerElement, V: ContainerElement> UeMap<K, V>
Sourcepub fn bulk_iter(&self) -> UikaResult<BulkMapIter<K, V>>
pub fn bulk_iter(&self) -> UikaResult<BulkMapIter<K, V>>
Bulk-fetch all key-value pairs as a lazy iterator (single FFI call).
Source§impl<K: ContainerElement + Hash + Eq, V: ContainerElement> UeMap<K, V>
impl<K: ContainerElement + Hash + Eq, V: ContainerElement> UeMap<K, V>
Sourcepub fn to_hash_map(&self) -> UikaResult<HashMap<K, V>>
pub fn to_hash_map(&self) -> UikaResult<HashMap<K, V>>
Bulk-copy all key-value pairs to a HashMap in a single FFI call.
Trait Implementations§
Source§impl<K: Clone + ContainerElement, V: Clone + ContainerElement> Clone for UeMap<K, V>
impl<K: Clone + ContainerElement, V: Clone + ContainerElement> Clone for UeMap<K, V>
Source§impl<'a, K: ContainerElement, V: ContainerElement> IntoIterator for &'a UeMap<K, V>
impl<'a, K: ContainerElement, V: ContainerElement> IntoIterator for &'a UeMap<K, V>
impl<K: Copy + ContainerElement, V: Copy + ContainerElement> Copy for UeMap<K, V>
Auto Trait Implementations§
impl<K, V> Freeze for UeMap<K, V>
impl<K, V> RefUnwindSafe for UeMap<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for UeMap<K, V>
impl<K, V> Sync for UeMap<K, V>
impl<K, V> Unpin for UeMap<K, V>
impl<K, V> UnsafeUnpin for UeMap<K, V>
impl<K, V> UnwindSafe for UeMap<K, V>where
K: UnwindSafe,
V: 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