Struct shard_ecs::Registry[][src]

pub struct Registry { /* fields omitted */ }
Expand description

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.

Implementations

Internal function which scatters the pools of each archetype collection.

Adds a new entity to the Registry, constructed of the components in the given componentgroup instance.

Erases an existing entity, dropping it’s components. Returns true if succeeded.

Only removes an entity if it exactly matches the components. Otherwise the entity is not removed. Returns the components of the entity if removal was succesfull.

Adds a component instance to the given entity. Fails, returning the component, if allocation fails, already contains the given type, or the entity already has max amount of components. Also fails if given entity handle is invalid.

Removes a component instance from the given entity. Fails if such entity does not exist. Also fails if entity cannot be moved due to allocation failure.

Erases a component instance from the given entity. Fails if such entity does not exist. Essentially the same as remove_component, but drops the component instead of returning it. Also fails if entity cannot be moved due to allocation failure.

Returns a reference to a entity’s component of type C, if the entity contains such component.

Returns a mutable reference to a entity’s component of type C, if the entity contains such component.

Returns a reference to a entity’s components of types G, if the entity contains such components.

Returns a reference to a entity’s components of types G, if the entity contains such components.

Returns an iterator over all entities containing exactly and only the given component types.

Returns a mutable iterator over all entities containing exactly and only the given component types.

Returns an iterator over all entities containing the given component types.

Returns an iterator over all entities containing the given component types.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.