pub struct ArchitypicalErasedRegistry<HandleType, Metadata> { /* private fields */ }
Expand description
Registry that stores type-erased values in archetypes, each type corresponding to an archetype.
This is used by the MaterialManager to store materials of any type.
Implementations
sourceimpl<HandleType, Metadata> ArchitypicalErasedRegistry<HandleType, Metadata>
impl<HandleType, Metadata> ArchitypicalErasedRegistry<HandleType, Metadata>
pub fn new() -> Self
pub fn ensure_archetype<T: Send + Sync + 'static>(&mut self)
pub fn insert<T: Send + Sync + 'static>(
&mut self,
handle: &ResourceHandle<HandleType>,
data: T,
metadata: Metadata
) -> &mut Metadata
pub fn update<T: Send + Sync + 'static>(
&mut self,
handle: &ResourceHandle<HandleType>,
data: T,
renormalize: impl FnMut(&Metadata, usize)
) -> bool
pub fn remove_all_dead(&mut self, renormalize: impl FnMut(&Metadata, usize))
pub fn count(&self) -> usize
pub fn get_ref<T: Send + Sync + 'static>(
&self,
handle: RawResourceHandle<HandleType>
) -> &T
pub fn get_ref_full<T: Send + Sync + 'static>(
&self,
handle: RawResourceHandle<HandleType>
) -> (&T, &Metadata)
pub fn get_ref_full_by_index<T: Send + Sync + 'static>(
&self,
index: usize
) -> (&T, &Metadata)
pub fn get_metadata_mut<T: Send + Sync + 'static>(
&mut self,
handle: RawResourceHandle<HandleType>
) -> &mut Metadata
pub fn get_index(&self, handle: RawResourceHandle<HandleType>) -> usize
pub fn get_type_id(&self, handle: RawResourceHandle<HandleType>) -> TypeId
pub fn get_archetype_mut(&mut self, ty: TypeId) -> &mut Archetype<Metadata>
pub fn archetypes_mut(
&mut self
) -> impl ExactSizeIterator<Item = (TypeId, &mut VecAny)>
pub fn archetype_lengths(
&self
) -> impl ExactSizeIterator<Item = (TypeId, usize)> + '_
Trait Implementations
Auto Trait Implementations
impl<HandleType, Metadata> !RefUnwindSafe for ArchitypicalErasedRegistry<HandleType, Metadata>
impl<HandleType, Metadata> Send for ArchitypicalErasedRegistry<HandleType, Metadata> where
HandleType: Send,
Metadata: Send,
impl<HandleType, Metadata> Sync for ArchitypicalErasedRegistry<HandleType, Metadata> where
HandleType: Sync,
Metadata: Sync,
impl<HandleType, Metadata> !Unpin for ArchitypicalErasedRegistry<HandleType, Metadata>
impl<HandleType, Metadata> !UnwindSafe for ArchitypicalErasedRegistry<HandleType, Metadata>
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