pub struct ArchetypeStore { /* private fields */ }Expand description
Registry of all archetypes, indexed by layout.
Implementations§
Source§impl ArchetypeStore
impl ArchetypeStore
Sourcepub fn register_column<T: Send + Sync + 'static>(&mut self)
pub fn register_column<T: Send + Sync + 'static>(&mut self)
Register a column factory for a component type. Must be called before
get_or_create is called with a layout containing that type.
Sourcepub fn get_or_create(&mut self, layout: ArchetypeLayout) -> ArchetypeId
pub fn get_or_create(&mut self, layout: ArchetypeLayout) -> ArchetypeId
Look up or create the archetype for layout.
Sourcepub fn get(&self, id: ArchetypeId) -> &Archetype
pub fn get(&self, id: ArchetypeId) -> &Archetype
Get an archetype by ID.
Sourcepub fn get_mut(&mut self, id: ArchetypeId) -> &mut Archetype
pub fn get_mut(&mut self, id: ArchetypeId) -> &mut Archetype
Get a mutable archetype by ID.
Sourcepub fn iter_mut(&mut self) -> impl Iterator<Item = &mut Archetype>
pub fn iter_mut(&mut self) -> impl Iterator<Item = &mut Archetype>
Iterate all archetypes mutably.
Sourcepub fn get_two_mut(
&mut self,
a: ArchetypeId,
b: ArchetypeId,
) -> (&mut Archetype, &mut Archetype)
pub fn get_two_mut( &mut self, a: ArchetypeId, b: ArchetypeId, ) -> (&mut Archetype, &mut Archetype)
Get mutable references to two different archetypes simultaneously.
Panics if a == b.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ArchetypeStore
impl !UnwindSafe for ArchetypeStore
impl Freeze for ArchetypeStore
impl Send for ArchetypeStore
impl Sync for ArchetypeStore
impl Unpin for ArchetypeStore
impl UnsafeUnpin for ArchetypeStore
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