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§
- Column
- A type-erased contiguous container for data of a homogeneous type.
- Component
Sparse Set - A sparse data structure of
Components. - Resource
Data - The type-erased backing storage and metadata for a single resource within a
World. - Resources
- The backing store for all
Resources stored in theWorld. - Sparse
Set - A data structure that blends dense and sparse storage
- Sparse
Sets - A collection of
ComponentSparseSetstorages, indexed byComponentId - Storages
- The raw data stores of a
World - Table
- A column-oriented structure-of-arrays based storage for
Components of entities in aWorld. - TableId
- An opaque unique ID for a
Tablewithin aWorld. - Table
Row - An opaque newtype for rows in
Tables. Specifies a single row in a specific table. - Tables
- A collection of
Tablestorages, indexed byTableId - Thin
Column - Very similar to a normal
Column, but with the capacities and lengths cut out for performance reasons.
Traits§
- Sparse
SetIndex - Represents something that can be stored in a
SparseSetas an integer.