Crate specs [] [src]

SPECS Parallel ECS

This library provides an ECS variant designed for parallel execution and convenient usage. It is highly flexible when it comes to actual component data and the way it is stored and accessed.

Structs

Allocator

Internally used structure for Entity allocation.

AntiStorage

An inverted storage type, only useful to iterate entities that do not have a particular component type.

CreateEntities

Entity creation iterator. Will yield new empty entities infinitely. Useful for bulk entity construction, since the locks are only happening once.

Entities

A custom entity guard used to hide the the fact that Generations is lazily created and updated. For this to be useful it must be joined with a component. This is because the Generation table includes every possible Generation of Entities even if they have never been

Entity

Entity type, as seen by the user.

EntityBuilder

Helper builder for entities.

Generation

Index generation. When a new entity is placed at an old index, it bumps the Generation by 1. This allows to avoid using components from the entities that were deleted.

HashMapStorage

HashMap-based storage. Best suited for rare components.

JoinIter

JoinIter is an Iterator over a group of Storages.

MaskedStorage

The UnprotectedStorage together with the BitSet that knows about which elements are stored, and which are not.

NullStorage

A null storage type, used for cases where the component doesn't contain any data and instead works as a simple flag.

Planner

System execution planner. Allows running systems via closures, distributes the load in parallel using a thread pool.

RunArg

System closure run-time argument.

Storage

A wrapper around the masked storage and the generations vector. Can be used for safe lookup of components, insertions and removes. This is what World::read/write locks for the user.

SystemInfo

System information package, where the system itself is accompanied by its name and priority.

VecStorage

Vec-based storage, stores the generations of the data in order to match with given entities. Supposed to have maximum performance for the components mostly present in entities.

World

The World struct contains all the data, which is entities and their components. All methods are supposed to be valid for any context they are available in. The type parameter C is for component identification in addition of their types.

Enums

InsertResult

the status of an insert operation

Traits

Component

Abstract component type. Doesn't have to be Copy or even Clone.

Join

The purpose of the Join trait is to provide a way to access multiple storages at the same time with the merged bit set.

System

Generic system that runs through the entities and do something with their components, with an ability to add new entities and delete existing ones.

UnprotectedStorage

Used by the framework to quickly join componets

Type Definitions

Index

Index type is arbitrary. It doesn't show up in any interfaces. Keeping it 32bit allows for a single 64bit word per entity.

Priority

System scheduling priority. Higehr priority systems are started earlier than lower-priority ones.