pub struct ArchetypicalRegistry<K, V, HandleType> { /* private fields */ }
Expand description
Registry that stores the values in archetypes, each key representing an archetype.
This is used by the ObjectManager to store objects. It uses the material archetype and a custom u64 as the key.
Implementations
sourceimpl<K, V, HandleType> ArchetypicalRegistry<K, V, HandleType> where
K: Copy + Eq + Hash,
impl<K, V, HandleType> ArchetypicalRegistry<K, V, HandleType> where
K: Copy + Eq + Hash,
pub fn new() -> Self
pub fn insert(&mut self, handle: &ResourceHandle<HandleType>, data: V, key: K)
pub fn remove_all_dead(&mut self, remove_fn: impl FnMut(usize, V))
pub fn set_key(&mut self, handle: RawResourceHandle<HandleType>, key: K)
pub fn count(&self) -> usize
pub fn get_value_mut(&mut self, handle: RawResourceHandle<HandleType>) -> &mut V
pub fn get_archetype_vector(&self, key: &K) -> Option<&[V]>
sourcepub fn iter_all_values_mut(&mut self) -> impl Iterator<Item = &mut V>
pub fn iter_all_values_mut(&mut self) -> impl Iterator<Item = &mut V>
Returns an iterator over all values regardless of its archetype
Trait Implementations
Auto Trait Implementations
impl<K, V, HandleType> RefUnwindSafe for ArchetypicalRegistry<K, V, HandleType> where
HandleType: RefUnwindSafe,
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V, HandleType> Send for ArchetypicalRegistry<K, V, HandleType> where
HandleType: Send,
K: Send,
V: Send,
impl<K, V, HandleType> Sync for ArchetypicalRegistry<K, V, HandleType> where
HandleType: Sync,
K: Sync,
V: Sync,
impl<K, V, HandleType> Unpin for ArchetypicalRegistry<K, V, HandleType> where
HandleType: Unpin,
K: Unpin,
V: Unpin,
impl<K, V, HandleType> UnwindSafe for ArchetypicalRegistry<K, V, HandleType> where
HandleType: UnwindSafe,
K: UnwindSafe,
V: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more