pub struct JoinIndex { /* private fields */ }Expand description
Entity to component-row index: which components an entity has, and where each one’s row sits in its column.
Implementations§
Source§impl JoinIndex
impl JoinIndex
Sourcepub fn set(&mut self, entity: Entity, id: ComponentId, row: u32)
pub fn set(&mut self, entity: Entity, id: ComponentId, row: u32)
Record that entity has component id, stored at row in that
component’s column. If entity is a fresh occupant of its index (first
use, or a recycled index), the previous occupant’s state is dropped first.
Sourcepub fn clear(&mut self, entity: Entity, id: ComponentId)
pub fn clear(&mut self, entity: Entity, id: ComponentId)
Forget that entity has component id. Frees the index slot once the
entity has no components left, so the index reads as unused again.
Sourcepub fn clear_entity(&mut self, entity: Entity)
pub fn clear_entity(&mut self, entity: Entity)
Forget every component of entity. Called when the entity is despawned.
Sourcepub fn mask(&self, entity: Entity) -> ComponentMask
pub fn mask(&self, entity: Entity) -> ComponentMask
The set of components entity has. An empty mask for a stale handle.
Sourcepub fn row(&self, entity: Entity, id: ComponentId) -> Option<u32>
pub fn row(&self, entity: Entity, id: ComponentId) -> Option<u32>
The row of entity in component id’s column, or None if it lacks that
component (or the handle is stale).
Sourcepub fn matches(
&self,
entity: Entity,
required: ComponentMask,
excluded: ComponentMask,
) -> bool
pub fn matches( &self, entity: Entity, required: ComponentMask, excluded: ComponentMask, ) -> bool
Whether entity has all of required and none of excluded.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for JoinIndex
impl RefUnwindSafe for JoinIndex
impl Send for JoinIndex
impl Sync for JoinIndex
impl Unpin for JoinIndex
impl UnsafeUnpin for JoinIndex
impl UnwindSafe for JoinIndex
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