EntityStore

Trait EntityStore 

Source
pub trait EntityStore {
    // Required methods
    fn id(&self) -> WorldId;
    fn entry_ref(
        &self,
        entity: Entity,
    ) -> Result<EntryRef<'_>, EntityAccessError>;
    fn entry_mut(
        &mut self,
        entity: Entity,
    ) -> Result<EntryMut<'_>, EntityAccessError>;
    fn get_component_storage<V>(
        &self,
    ) -> Result<StorageAccessor<'_>, EntityAccessError>
       where V: for<'b> View<'b>;
}
Expand description

The EntityStore trait abstracts access to entity data as required by queries for both World and SubWorld

Required Methods§

Source

fn id(&self) -> WorldId

Returns the world’s unique ID.

Source

fn entry_ref(&self, entity: Entity) -> Result<EntryRef<'_>, EntityAccessError>

Returns an entity entry which can be used to access entity metadata and components.

Source

fn entry_mut( &mut self, entity: Entity, ) -> Result<EntryMut<'_>, EntityAccessError>

Returns a mutable entity entry which can be used to access entity metadata and components.

Source

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

Returns a component storage accessor for component types declared in the specified View.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§