Trait termite::StorageSet

source ·
pub trait StorageSet: Send + Sync + 'static {
    fn new(desc: ComponentDescriptor, capacity: usize) -> Self;
    fn contains(&self, entity: Entity) -> bool;
    fn entity_ids(&self) -> EntityIdSet;
    unsafe fn insert(
        &mut self,
        entity: Entity,
        component: *mut u8,
        change_ticks: u32
    ); unsafe fn remove_unchecked(&mut self, entity: Entity, component: *mut u8); fn remove_and_drop(&mut self, entity: Entity); unsafe fn get_unchecked(&self, entity: Entity) -> *mut u8; unsafe fn get_ticks_unchecked(
        &self,
        entity: Entity
    ) -> &UnsafeCell<ChangeTicks>; unsafe fn get_with_ticks_unchecked(
        &self,
        entity: Entity
    ) -> (*mut u8, &UnsafeCell<ChangeTicks>); fn get(&self, entity: Entity) -> Option<*mut u8> { ... } }

Required Methods

Create a new storage for the given component type T.

Returns true if the storage contains a component for the given entity.

Inserts a component for the given entity.

Safety
  • The storage must be able to store components of type T.

Removes a component for the given entity.

Safety
  • entity must be contained in the storage.
  • component must be a valid pointer.

Removes a component for the given entity.

Returns a pointer to the component for the given entity.

Safety
  • entity must be contained in the storage.

Returns change ticks for the given entity.

Safety
  • entity must be contained in the storage.

Returns a pointer to the component for the given entity and it’s change ticks.

Safety
  • entity must be contained in the storage.

Provided Methods

Returns a pointer to the component for the given entity.

Implementors