Expand description
Storage layouts for ECS data.
This module implements the low-level collections that store data in a World
. These all offer minimal and often
unsafe APIs, and have been made pub
primarily for debugging and monitoring purposes.
§Fetching Storages
Each of the below data stores can be fetched via Storages
, which can be fetched from a
World
via World::storages
. It exposes a top level container for each class of storage within
ECS:
Tables
- columnar contiguous blocks of memory, optimized for fast iteration.SparseSets
- sparseHashMap
-like mappings from entities to components, optimized for random lookup and regular insertion/removal of components.Resources
- singleton storage for the resources in the world
§Safety
To avoid trivially unsound use of the APIs in this module, it is explicitly impossible to get a mutable
reference to Storages
from World
, and none of the types publicly expose a mutable interface.
Structs§
- A type-erased contiguous container for data of a homogeneous type.
- A sparse data structure of
Component
s. - The type-erased backing storage and metadata for a single resource within a
World
. - A data structure that blends dense and sparse storage
- A collection of
ComponentSparseSet
storages, indexed byComponentId
- The raw data stores of a
World
- A opaque newtype for rows in
Table
s. Specifies a single row in a specific table.
Traits§
- Represents something that can be stored in a
SparseSet
as an integer.