---
# System prepended metadata

title: Entity reference type reflection
tags: [ECS]

---

# Entity reference type reflection

```rust=
impl<'w> UnsafeEntityCell<'w> {

    // Renamed API bits (added "untyped")

    pub unsafe fn get_untyped_by_id(self, component_id: ComponentId)
        -> Option<Ptr<'w>>;
    pub unsafe fn get_untyped_mut_by_id(self, component_id: ComponentId)
        -> Result<MutUntyped<'w>, GetEntityMutByIdError>;
    pub unsafe fn get_untyped_mut_assume_mutable_by_id(self, component_id: ComponentId)
        -> Result<MutUntyped<'w>, GetEntityMutByIdError>;
    
    // New API bits

    pub unsafe fn iter_untyped(self) -> impl Iterator<Item = (ComponentId, Ptr<'w>)>;
    pub unsafe fn iter_untyped_mut(self) -> impl Iterator<Item = (ComponentId, MutUntyped<'w>)>;
    

}
```