Expand description
Component storage types, implementations for component joins, etc.
Structs§
- Anti
Storage - An inverted storage type, only useful to iterate entities that do not have a particular component type.
- BTree
Storage - BTreeMap-based storage.
- Default
VecStorage - Vector storage, like
VecStorage
, but allows safe access to the interior slices because unused slots are always initialized. - Dense
VecStorage - Dense vector storage. Has a redirection 2-way table between entities and components, allowing to leave no gaps within the data.
- Deref
Flagged Storage - Wrapper storage that tracks modifications, insertions, and removals of
components through an
EventChannel
, in a similar manner toFlaggedStorage
. - Entries
LendJoin
-able structure that yields all indices, returningStorageEntry
for all elements.- Flagged
Access Mut - Wrapper type only emits modificaition events when the component is accessed
via mutably dereferencing. Also see
DerefFlaggedStorage
documentation. - Flagged
Storage - Wrapper storage that tracks modifications, insertions, and removals of
components through an
EventChannel
. - Hash
MapStorage HashMap
-based storage. Best suited for rare components.- Masked
Storage - The
UnprotectedStorage
together with theBitSet
that knows about which elements are stored, and which are not. - Null
Storage - A null storage type, used for cases where the component doesn’t contain any data and instead works as a simple flag.
- Occupied
Entry - An entry to a storage which has a component associated to the entity.
- Paired
Storage Read - Pairs a storage with an index, meaning that the index is guaranteed to exist
as long as the
PairedStorage<C>
exists. - Paired
Storage Write Exclusive - Pairs a storage with an index, meaning that the index is guaranteed to exist.
- Paired
Storage Write Shared - Pairs a storage with an index, meaning that the index is guaranteed to exist.
- Restricted
Storage - Similar to a
MaskedStorage
and aStorage
combined, but restricts usage to only getting and modifying the components. That means it’s not possible to modify the inner bitset so the iteration cannot be invalidated. In other words, no insertion or removal is allowed. - Shared
GetMut Only - This type provides a way to ensure only
shared_get_mut
can be called for the lifetime'a
and that no references previously obtained from the storage exist when it is created. While internally this is a shared reference, constructing it requires an exclusive borrow for the lifetime'a
. - Shared
GetOnly - This type provides a way to ensure only
shared_get_mut
andget
can be called for the lifetime'a
and that no references previously obtained from the storage exist when it is created. While internally this is a shared reference, constructing it requires an exclusive borrow for the lifetime'a
. - Storage
- A wrapper around the masked storage and the generations vector.
Can be used for safe lookup of components, insertions and removes.
This is what
World::read/write
fetches for the user. - Vacant
Entry - An entry to a storage which does not have a component associated to the entity.
- VecStorage
- Vector storage. Uses a simple
Vec
. Supposed to have maximum performance for the components mostly present in entities.
Enums§
- Component
Event - Component storage events received from a
FlaggedStorage
or any storage that implementsTracked
. - Storage
Entry - Entry to a storage for convenient filling of components or removal based on whether the entity has a component.
Traits§
- Access
Mut - DerefMut without autoderefing.
- AnyStorage
- A dynamic storage.
- Distinct
Storage - This is a marker trait which requires you to uphold the following guarantee:
- Generic
Read Storage - Provides generic read access to both
ReadStorage
andWriteStorage
- Generic
Write Storage - Provides generic write access to
WriteStorage
, both as a value and a mutable reference. - Shared
GetMut Storage - Used by the framework to mutably access components in contexts where exclusive access to the storage is not possible.
- Slice
Access - Some storages can provide slices to access the underlying data.
- Tracked
UnprotectedStorage
s that track modifications, insertions, and removals of components.- TryDefault
- Tries to create a default value, returns an
Err
with the name of the storage and/or component if there’s no default. - Unprotected
Storage - Used by the framework to quickly join components.
Type Aliases§
- Insert
Result - The status of an
insert()
ion into a storage. If the insertion was successful then the Ok value will contain the component that was replaced (if any). - Read
Storage - A storage with read access.
- Write
Storage - A storage with read and write access.