pub struct SparseSet<T: Component, Track: Tracking = <T as Component>::Tracking> { /* private fields */ }
Expand description

Default component storage.

Implementations

Returns a new SparseSet to be used in custom storage.

Returns a slice of all the components in this storage.

Returns true if entity owns a component in this storage.

Returns the length of the storage.

Returns true if the storage’s length is 0.

Returns the index of entity’s component in the dense and data vectors.
This index is only valid for this storage and until a modification happens.

Returns the index of entity’s component in the dense and data vectors.
This index is only valid for this storage and until a modification happens.

Safety

entity has to own a component of this type.
The index is only valid until a modification occurs in the storage.

Returns the EntityId at a given index.

Clear all deletion tracking data.

Clear all deletion tracking data older than some timestamp.

Clear all deletion and removal tracking data.

Clear all deletion and removal tracking data older than some timestamp.

Clear all removal tracking data.

Clear all removal tracking data older than some timestamp.

Clear all deletion and removal tracking data.

Clear all deletion and removal tracking data older than some timestamp.

Clear all deletion tracking data.

Clear all deletion tracking data older than some timestamp.

Clear all removal tracking data.

Clear all removal tracking data older than some timestamp.

Clear all deletion and removal tracking data.

Clear all deletion and removal tracking data older than some timestamp.

Returns true if the storage tracks insertion.

Returns true if the storage tracks modification.

Returns true if the storage tracks deletion.

Returns true if the storage tracks removal.

Returns true if the storage tracks insertion, modification, deletion or removal.

Reserves memory for at least additional components. Adding components can still allocate though.

Sorts the SparseSet with a comparator function, but may not preserve the order of equal elements.

Sorts the SparseSet, but may not preserve the order of equal elements.

Trait Implementations

Converts this type into a mutable reference of the (usually inferred) input type.

Converts this type into a shared reference of the (usually inferred) input type.

Converts this type into a shared reference of the (usually inferred) input type.

Formats the value using the given formatter. Read more

Deletes an entity from this storage.

Deletes all components of this storage.

Returns how much memory this storage uses.

Returns a SparseSet’s internal SparseArray. Read more

Returns true if the storage is empty.

Clear all deletion and removal tracking data.

Clear all deletion and removal tracking data older than some timestamp.

Casts to &dyn Any.

Casts to &mut dyn Any.

Returns the storage’s name.

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

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. 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.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more