pub struct Archetype { /* private fields */ }Expand description
A group of entities that share the same set of component types.
Columns are independently borrowable — no double-borrow of a HashMap
needed for multi-component queries.
Implementations§
Source§impl Archetype
impl Archetype
Sourcepub fn id(&self) -> ArchetypeId
pub fn id(&self) -> ArchetypeId
The archetype’s ID.
Sourcepub fn layout(&self) -> &ArchetypeLayout
pub fn layout(&self) -> &ArchetypeLayout
The archetype’s layout.
Sourcepub fn column<T: Send + Sync + 'static>(&self) -> Option<&Column<T>>
pub fn column<T: Send + Sync + 'static>(&self) -> Option<&Column<T>>
Get a typed column reference. Returns None if the type isn’t in this
archetype’s layout.
Sourcepub fn column_mut<T: Send + Sync + 'static>(&mut self) -> Option<&mut Column<T>>
pub fn column_mut<T: Send + Sync + 'static>(&mut self) -> Option<&mut Column<T>>
Get a typed column mutable reference.
Sourcepub fn column_raw(&self, type_id: TypeId) -> Option<&dyn AnyColumn>
pub fn column_raw(&self, type_id: TypeId) -> Option<&dyn AnyColumn>
Get a type-erased column reference.
Sourcepub fn column_raw_mut(&mut self, type_id: TypeId) -> Option<&mut dyn AnyColumn>
pub fn column_raw_mut(&mut self, type_id: TypeId) -> Option<&mut dyn AnyColumn>
Get a type-erased column mutable reference.
Sourcepub fn entities_and_column_mut<T: Send + Sync + 'static>(
&mut self,
) -> Option<(&[Entity], &mut Column<T>)>
pub fn entities_and_column_mut<T: Send + Sync + 'static>( &mut self, ) -> Option<(&[Entity], &mut Column<T>)>
Split-borrow: shared entity slice + exclusive column reference.
Returns None if the archetype doesn’t contain type T.
Sourcepub fn entities_and_two_columns_mut<A, B>(
&mut self,
) -> Option<(&[Entity], &mut Column<A>, &mut Column<B>)>
pub fn entities_and_two_columns_mut<A, B>( &mut self, ) -> Option<(&[Entity], &mut Column<A>, &mut Column<B>)>
Split-borrow: shared entity slice + two exclusive column references.
Panics if A == B. Returns None if either type is absent.
Sourcepub fn entities_and_three_columns_mut<A, B, C>(
&mut self,
) -> Option<(&'_ [Entity], &'_ mut Column<A>, &'_ mut Column<B>, &'_ mut Column<C>)>
pub fn entities_and_three_columns_mut<A, B, C>( &mut self, ) -> Option<(&'_ [Entity], &'_ mut Column<A>, &'_ mut Column<B>, &'_ mut Column<C>)>
Split-borrow: shared entity slice + three exclusive column references.
Panics if any two queried types are the same. Returns None if any
type is absent from this archetype.
Sourcepub fn edge(&self, type_id: TypeId) -> Option<&ArchetypeEdge>
pub fn edge(&self, type_id: TypeId) -> Option<&ArchetypeEdge>
Get the edge cache entry for a component type.