Struct shard_ecs::descriptors::archetype_descriptor::ArchetypeDescriptor[][src]

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

Represents a combination of components. Each component type MUST be unique (i.e. no duplicate component types). Length must be larger than 0 and lower or equal to MAX_COMPONENTS_PER_ENTITY. Use the ArchetypeDescriptor::is_valid function to check for validity. Any use of an invalid archetype descriptor is considered UB.

Implementations

The invalid archetype descriptor. Has 0 components and an ArchetypeId of 0.

Returns true if it is a valid archetype. A valid archetype has a length larger than 0 and smaller than MAX_COMPONENTS_PER_ENTITY. It also contains no duplicate components.

Creates a new archetype descriptor with the given id, length and components.

Computes an archetype ID, returns ArchetypeId::INVALID if given an invalid combination of components.

Returns whether the descriptor provided is contained in self. (i.e. subset inclusion) Do not provide an invalid descriptor to this!

Returns whether the descriptor provided is excluded from self. (i.e. subset exclusion) Do not provide an invalid descriptor to this!

Returns a new archetype with the given component type added to it. Returns none if the current archetype already contains the component type or it is full.

Returns a new archetype with the given component type added to it. Returns none if the current archetype already contains the component type or it is full.

Returns whether the archetype descriptor has a given component type.

Get a the archetype descriptor’s archetype id.

Get the archetype descriptor’s component count.

Get a reference to the archetype descriptor’s components. This version is const but unsafe, as length is NOT accounted for. Therefore any descriptor past the len is considered invalid or garbage data.

Get a reference to the archetype descriptor’s components.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

Performs the conversion.

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 resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

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.