Module hecs::serialize::column

source ·
Available on crate feature column-serialize only.
Expand description

Fast column-major serialization

Stores each archetype in a block where each type of component is laid out contiguously. Preferred for data that will be read/written programmatically. Efficient, compact, and highly compressible, but difficult to read or edit by hand.

This module builds on the public archetype-related APIs and World::spawn_column_batch_at(), and is somewhat opinionated. For some applications, a custom approach may be preferable.

In terms of the serde data model, we treat a World as a sequence of archetypes, where each archetype is a 4-tuple of an entity count n, component count k, a k-tuple of user-controlled component IDs, and a k+1-tuple of n-tuples of components, such that the first n-tuple contains Entity values and the remainder each contain components of the type identified by the corresponding component ID.

Traits

Functions