Struct entity_data::archetype::component::ComponentStorage
source · pub struct ComponentStorage<'a, C, D> { /* private fields */ }
Implementations§
source§impl<'a, C: Component, D: Borrow<UnsafeVec>> ComponentStorage<'a, C, D>
impl<'a, C: Component, D: Borrow<UnsafeVec>> ComponentStorage<'a, C, D>
sourcepub fn contains(&self, entity_id: ArchEntityId) -> bool
pub fn contains(&self, entity_id: ArchEntityId) -> bool
Checks whether self
container specific entity.
sourcepub unsafe fn get_unchecked(&self, entity_id: ArchEntityId) -> &'a C
pub unsafe fn get_unchecked(&self, entity_id: ArchEntityId) -> &'a C
Returns a reference to the component C
of the specified entity.
Safety: entity must exist.
sourcepub fn get(&self, entity_id: ArchEntityId) -> Option<&'a C>
pub fn get(&self, entity_id: ArchEntityId) -> Option<&'a C>
Returns a reference to component C
of the specified entity.
source§impl<'a, C: Component> ComponentStorage<'a, C, &'a UnsafeVec>
impl<'a, C: Component> ComponentStorage<'a, C, &'a UnsafeVec>
source§impl<'a, C: Component> ComponentStorage<'a, C, &'a mut UnsafeVec>
impl<'a, C: Component> ComponentStorage<'a, C, &'a mut UnsafeVec>
sourcepub unsafe fn get_unchecked_mut(&mut self, entity_id: ArchEntityId) -> &'a mut C
pub unsafe fn get_unchecked_mut(&mut self, entity_id: ArchEntityId) -> &'a mut C
Returns a mutable reference to the component C
of the specified entity id.
Safety: component at entity_id
must exist.
sourcepub fn get_mut(&mut self, entity_id: ArchEntityId) -> Option<&'a mut C>
pub fn get_mut(&mut self, entity_id: ArchEntityId) -> Option<&'a mut C>
Returns a mutable reference to the component C
of the specified entity id.
Trait Implementations§
impl<'a, C, D: Borrow<UnsafeVec> + Copy> Copy for ComponentStorage<'a, C, D>
Auto Trait Implementations§
impl<'a, C, D> RefUnwindSafe for ComponentStorage<'a, C, D>where C: RefUnwindSafe, D: RefUnwindSafe,
impl<'a, C, D> Send for ComponentStorage<'a, C, D>where C: Send, D: Send,
impl<'a, C, D> Sync for ComponentStorage<'a, C, D>where C: Sync, D: Sync,
impl<'a, C, D> Unpin for ComponentStorage<'a, C, D>where C: Unpin, D: Unpin,
impl<'a, C, D> UnwindSafe for ComponentStorage<'a, C, D>where C: UnwindSafe, D: UnwindSafe,
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