Struct entity_data::Archetype
source · [−]pub struct Archetype { /* private fields */ }Expand description
A collection of entities with unique combination of components. An archetype can hold a maximum of 2^32-1 entities.
Implementations
sourceimpl Archetype
impl Archetype
pub const MAX_ENTITIES: u32 = 4_294_967_294u32
pub fn is_present(&self, entity_id: u32) -> bool
sourcepub fn get<C: Component>(&self, entity_id: u32) -> Option<&C>
pub fn get<C: Component>(&self, entity_id: u32) -> Option<&C>
Returns a reference to the component C of the specified entity id.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Archetype
impl Send for Archetype
impl Sync for Archetype
impl Unpin for Archetype
impl UnwindSafe for Archetype
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more