Crate shard_ecs[][src]

Re-exports

pub use crate::*;

Modules

Macros

Structs

Bundles together necessary abstract function pointers for modifying component pools.

Represents a full fat archetype of components. Stores all data of up-to 8 components in order to allocate them.

Represents the unique subset of components as a comparable identifier.

Represents a set of componentpools and associated entity data for a given archetype.

Represents a collection of Archetypepools for a given archetype.

Returned whenever a component allocation fails.

Represents the type of a Component as an identifier.

Default allocator for components. Allocates in AoS fashion, storing components sequantially in memory.

Represents an abstract Entity. Is internally a handle into the ECS to query it’s associated components.

Opaque handle type represented using integer values internally.

The main Registry of the ECS. Essentially an instance of the ECS. Systems in this ECS implementation are implicit, meaning anything can be a system as decided by the user.

Builder type used to construct ECS Registry’s.

Opaque handle type storing both the actual integer value as well as versioning information.

Enums

General ECS error type.

Constants

Amount of component instances in each pool.

Used amount of bits in an entityhandle for storing the version. Is defined to be 8 bits. Thus, yielding 2^8 = 256 different versions.

Used amount of bits in the entityhandle for storing the index. Is defined to be 24 bits. Thus, yielding 2^24 = 16_777_216 different indices/entities.

Max amount of unique archetypes that can exist. Defined to be 2^16 - 1. Therefore, a u16 can be used to store the index of the archetype. u16::MAX is used to mark validness of such an archetype index.

Max amount of pools per archetype that can exist. Is defined to be 65536: 2^16. As at most all entities can have 1 component of a given type. Therefore, pool_count * components_per_pool == entity_count must hold.

Largest amount of components possible for a single entity. Is defined to be 8 at most.

Largest amount of entities than can be inserted into the registry. Is defined to be: 16_777_216

Traits

Trait implemented for all types to be used as components.

Custom component allocator trait. The allocator determines the alignment of a memory allocation (default = 4096 components per alloc).

Represents a group of components. Used for specifying which component types should be matched in query’s.

Marker trait for tuples of mutable slices. Implemented for tupes upto 16.

Marker trait for tuples of slices. Implemented for tupes upto 16.

Functions

Computes 32-bits fnv1a hash and xors higher and lower 16-bits. Up to limit if provided, otherwise slice length. If limit is zero or exceeds slice length, slice length is used instead.

Computes 32-bits fnv1a hash of the given slice, or up-to limit if provided. If limit is zero or exceeds slice length, slice length is used instead.

Computes 32-bits fnv1a hash of the given slice, or up-to limit if provided. If limit is zero or exceeds slice length, slice length is used instead.

Computes 16-bit fnv1a hash from a str.

Computes 32-bit fnv1a hash from a str.

Computes 64-bit fnv1a hash from a str.