Module specs::prelude

source ·
Expand description

Prelude module

Contains all of the most common traits, structures,

Re-exports

pub use join::Join;
pub use changeset::ChangeSet;
pub use storage::Storage;
pub use world::Builder;
pub use world::EntityBuilder;
pub use world::World;

Structs

Like, Dispatcher but works asynchronously.
A BitSet is a simple set designed to track which indices are placed into it.
Dense vector storage. Has a redirection 2-way table between entities and components, allowing to leave no gaps within the data.
The dispatcher struct, allowing systems to be executed in parallel.
Entity type, as seen by the user.
Wrapper storage that tracks modifications, insertions, and removals of components through an EventChannel.
HashMap-based storage. Best suited for rare components.
Lazy updates can be used for world updates that need to borrow a lot of resources and as such should better be done at the end. They work lazily in the sense that they are dispatched when calling world.maintain().
A null storage type, used for cases where the component doesn’t contain any data and instead works as a simple flag.
Allows to fetch a resource in a system immutably.
A reader ID which represents a subscription to the events pushed to the EventChannel.
A resource container, which provides methods to access to the contained resources.
The static accessor that is used for SystemData.
Vector storage. Uses a simple Vec. Supposed to have maximum performance for the components mostly present in entities.
Allows to fetch a resource in a system mutably.

Enums

Component storage events received from a FlaggedStorage or any storage that implements Tracked.

Traits

A trait for accessing read/write multiple resources from a system. This can be used to create dynamic systems that don’t specify what they fetch at compile-time.
Abstract component type. Doesn’t have to be Copy or even Clone.
The purpose of the ParJoin trait is to provide a way to access multiple storages in parallel at the same time with the merged bit set.
Parallel version of the standard iterator trait.
Trait for fetching data and running systems. Automatically implemented for systems.
A System, executed with a set of required Resources.
A static system data that can specify its dependencies at statically (at compile-time). Most system data is a SystemData, the DynamicSystemData type is only needed for very special setups.
UnprotectedStorages that track modifications, insertions, and removals of components.

Type Definitions

A wrapper for a read Entities resource. Note that this is just Read<Entities>, so you can easily use it in your system:
Allows to fetch a resource in a system immutably. This will panic if the resource does not exist. Usage of Read or Option<Read> is therefore recommended.
A storage with read access.
Allows to fetch a resource in a system mutably. This will panic if the resource does not exist. Usage of Write or Option<Write> is therefore recommended.
A storage with read and write access.