pub struct EntityIndex(pub u32);Expand description
Per-user dense index for a GlobalEntity known to a UserDiffHandler.
Phase 8.1 Stage A introduces this newtype as the in-process key for
dirty-set tracking and (eventually) packed mask storage. Each user’s
UserDiffHandler issues one EntityIndex per GlobalEntity it
observes via crate::KeyGenerator32, recycling on
deregister_component once the entity has no remaining components in
the user’s receiver map. u32 instead of u16 because the index space
is per-user (16K indices isn’t always enough at multi-thousand entity
scopes) and because KeyGenerator’s u16 wrap-around bug was already
noted as a follow-up item.
Wire-format independent. This index never crosses the wire; it’s purely an in-memory shortcut so dirty queues and (Stage B) bit-vec membership tests can use Vec-indexed operations instead of HashMap probes.
Tuple Fields§
§0: u32Trait Implementations§
Source§impl Clone for EntityIndex
impl Clone for EntityIndex
Source§fn clone(&self) -> EntityIndex
fn clone(&self) -> EntityIndex
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EntityIndex
impl Debug for EntityIndex
Source§impl From<EntityIndex> for u32
impl From<EntityIndex> for u32
Source§fn from(value: EntityIndex) -> Self
fn from(value: EntityIndex) -> Self
Source§impl From<u32> for EntityIndex
impl From<u32> for EntityIndex
Source§impl Hash for EntityIndex
impl Hash for EntityIndex
Source§impl PartialEq for EntityIndex
impl PartialEq for EntityIndex
Source§fn eq(&self, other: &EntityIndex) -> bool
fn eq(&self, other: &EntityIndex) -> bool
self and other values to be equal, and is used by ==.