[]Trait acute_ecs::world::EntityStore

pub trait EntityStore {
    fn has_component<T>(&self, entity: Entity) -> bool
    where
        T: Component
;
fn has_component_by_id(
        &self,
        entity: Entity,
        component: ComponentTypeId
    ) -> bool;
fn get_component<T>(&self, entity: Entity) -> Option<Ref<'_, T>>
    where
        T: Component
;
unsafe fn get_component_mut_unchecked<T>(
        &self,
        entity: Entity
    ) -> Option<RefMut<'_, T>>
    where
        T: Component
;
fn get_tag<T>(&self, entity: Entity) -> Option<&T>
    where
        T: Tag
;
fn is_alive(&self, entity: Entity) -> bool;
fn get_component_storage<V>(
        &self
    ) -> Result<StorageAccessor<'_>, ComponentAccessError>
    where
        V: for<'a> View<'a>
; fn get_component_mut<T>(&mut self, entity: Entity) -> Option<RefMut<'_, T>>
    where
        T: Component
, { ... } }

A queryable collection of entities.

Required methods

fn has_component<T>(&self, entity: Entity) -> bool where
    T: Component

Checks that the provided Component is present on a given entity.

Returns true if it exists, otherwise false.

fn has_component_by_id(
    &self,
    entity: Entity,
    component: ComponentTypeId
) -> bool

Checks that the provided ComponentTypeId is present on a given entity.

Returns true if it exists, otherwise false.

fn get_component<T>(&self, entity: Entity) -> Option<Ref<'_, T>> where
    T: Component

Borrows component data for the given entity.

Returns Some(data) if the entity was found and contains the specified data. Otherwise None is returned.

Panics

This function may panic if the component was not declared as read by this system.

unsafe fn get_component_mut_unchecked<T>(
    &self,
    entity: Entity
) -> Option<RefMut<'_, T>> where
    T: Component

Borrows component data for the given entity. Does not perform static borrow checking.

Returns Some(data) if the entity was found and contains the specified data. Otherwise None is returned.

Safety

Accessing a component which is already being concurrently accessed elsewhere is undefined behavior.

Panics

This function may panic if any other code is currently borrowing T mutable or if the component was not declared as written by this system.

fn get_tag<T>(&self, entity: Entity) -> Option<&T> where
    T: Tag

Gets tag data for the given entity.

Returns Some(data) if the entity was found and contains the specified data. Otherwise None is returned.

fn is_alive(&self, entity: Entity) -> bool

Determines if the given Entity is alive within this World.

fn get_component_storage<V>(
    &self
) -> Result<StorageAccessor<'_>, ComponentAccessError> where
    V: for<'a> View<'a>, 

Gets the entity component storage. Validates that the world can provide access to everything needed by the view.

Loading content...

Provided methods

fn get_component_mut<T>(&mut self, entity: Entity) -> Option<RefMut<'_, T>> where
    T: Component

Mutably borrows entity data for the given entity.

Returns Some(data) if the entity was found and contains the specified data. Otherwise None is returned.

Panics

This function may panic if the component was not declared as written by this system.

Loading content...

Implementors

impl EntityStore for World

impl<'a> EntityStore for SubWorld<'a>

Loading content...