Struct entity_data::EntityStorage
source · [−]pub struct EntityStorage { /* private fields */ }Expand description
A container of entities.
Implementations
sourceimpl EntityStorage
impl EntityStorage
sourcepub fn new() -> EntityStorage
pub fn new() -> EntityStorage
Creates an empty EntityStorage.
sourcepub fn add_entity<const N: usize, S>(&mut self, state: S) -> EntityIdwhere
S: ArchetypeImpl<N> + 'static,
pub fn add_entity<const N: usize, S>(&mut self, state: S) -> EntityIdwhere
S: ArchetypeImpl<N> + 'static,
Creates a new entity and returns its identifier.
sourcepub fn get_archetype<A: IsArchetype + 'static>(&self) -> Option<&Archetype>
pub fn get_archetype<A: IsArchetype + 'static>(&self) -> Option<&Archetype>
Returns a reference to the specified archetype.
sourcepub fn get_archetype_mut<A: IsArchetype + 'static>(
&mut self
) -> Option<&mut Archetype>
pub fn get_archetype_mut<A: IsArchetype + 'static>(
&mut self
) -> Option<&mut Archetype>
Returns a mutable reference to the specified archetype.
sourcepub fn get<C: 'static>(&self, entity: &EntityId) -> Option<&C>
pub fn get<C: 'static>(&self, entity: &EntityId) -> Option<&C>
Returns a reference to the component C of the specified entity.
sourcepub fn get_mut<C: 'static>(&mut self, entity: &EntityId) -> Option<&mut C>
pub fn get_mut<C: 'static>(&mut self, entity: &EntityId) -> Option<&mut C>
Returns a mutable reference to the component C of the specified entity.
Auto Trait Implementations
impl RefUnwindSafe for EntityStorage
impl Send for EntityStorage
impl Sync for EntityStorage
impl Unpin for EntityStorage
impl UnwindSafe for EntityStorage
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