Struct legion::storage::PackedStorage[][src]

pub struct PackedStorage<T: Component> { /* fields omitted */ }
Expand description

Stores a slice of components of type T for each archetype. Archetype slices are sorted according to the group that component T belongs to. Each slice may be packed into a single allocation to optimise for group-based access.

Trait Implementations

An iterator of shared archetype slice references.

An iterator of mutable archetype slice references.

Copies new components into the specified archetype slice. Read more

Gets the component slice for the specified archetype.

Gets a mutable component slice for the specified archetype. Read more

Iterates through all archetype component slices.

Iterates through all mutable archetype component slices. Read more

Returns the number of archetype slices stored.

Returns true if the storage contains no archetypes.

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Moves a component to a new storage.

Moves a component from one archetype to another.

Inserts a new empty component slice for an archetype into this storage.

Moves an archetype’s component slice to a new storage.

Removes a component from an archetype slice, swapping it with the last component in the slice.

Packs archetype slices.

A heuristic estimating cache misses for an iteration through all components due to archetype fragmentation.

Returns the component metadata.

Returns a pointer to the given archetype’s component slice.

Returns a pointer to the given archetype’s component slice. Read more

Writes new components into the given archetype’s component slice via a memcopy. Read more

Notifies the storage of the start of a new epoch.

Ensures that the given spare capacity is available for component insertions. This is a performance hint and should not be required before extend_memcopy is called. 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

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait. Read more

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s. Read more

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s. Read more

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait. 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.