Expand description
The ECS prelude.
This includes the most common types in this crate, re-exported for your convenience.
Macros§
- Returns a
SpawnRelatedBundle
that will insert theChildren
component, spawn aSpawnableList
of entities with given bundles that relate to theChildren
entity via theChildOf
component, and reserve space in theChildren
for each spawned entity. - Returns a
SpawnRelatedBundle
that will insert the givenRelationshipTarget
, spawn aSpawnableList
of entities with given bundles that relate to theRelationshipTarget
entity via theRelationshipTarget::Relationship
component, and reserve space in theRelationshipTarget
for each spawned entity.
Structs§
- A filter on a component that only retains results the first time after they have been added.
- The
AnyOf
query parameter fetches entities with any of the component types included in T. - A
Resource
storingTypeRegistry
for type registrations relevant to a whole app. - A special
System
that instructs the executor to callSystem::apply_deferred
on the systems that have run but not applied theirDeferred
system parameters (likeCommands
) or other system buffers. - A filter on a component that only retains results the first time after they have been added or mutably dereferenced.
- Stores the parent entity of this child entity with this component.
- Tracks which entities are children of this parent entity.
- A
SystemParam
that stores a buffer which gets applied to theWorld
duringApplyDeferred
. This is used internally byCommands
to deferWorld
mutations. - Lightweight identifier of an entity.
- A list of commands that will be run to modify an
Entity
. - Provides mutable access to a single entity and all of its components.
- A read-only reference to a particular
Entity
and all of its components. - A mutable reference to a particular
Entity
, and the entire world. - Mutably reads events of type
T
keeping track of which events have already been read by each system allowing multiple systems to read the same events. Ideal for chains of systems that all want to modify the same events. - Reads events of type
T
in order and tracks which events have already been read. - Sends events of type
T
. - An event collection that represents the events that occurred within the last two
Events::update
calls. Events can be written to using anEventWriter
and are typically cheaply read using anEventReader
. - Returns a bool that describes if an entity has the component
T
. - A
SystemInput
type which denotes that aSystem
receives a mutable reference to a value of typeT
from its caller. - A
SystemInput
type which denotes that aSystem
receives a read-only reference to a value of typeT
from its caller. - A system local
SystemParam
. - Unique mutable borrow of an entity’s component or of a resource.
- Component used to identify an entity. Stores a hash for faster comparisons.
- Convenient query for giving a human friendly name to an entity.
- Shared borrow of a non-
Send
resource. - Unique borrow of a non-
Send
resource. - Trigger emitted when a component is inserted onto an entity that does not already have that component. Runs before
OnInsert
. Seecrate::component::ComponentHooks::on_add
for more information. - Trigger emitted when a component is inserted, regardless of whether or not the entity already had that component. Runs after
OnAdd
, if it ran. Seecrate::component::ComponentHooks::on_insert
for more information. - Trigger emitted when a component is removed from an entity, and runs before the component is removed, so you can still access the component data. See
crate::component::ComponentHooks::on_remove
for more information. - Trigger emitted when a component is inserted onto an entity that already has that component. Runs before the value is replaced, so you can still access the original component data. See
crate::component::ComponentHooks::on_replace
for more information. - A filter that tests if any of the given filters apply.
- An alternative to
Commands
that can be used in parallel contexts, such as those inQuery::par_iter
. - A collection of potentially conflicting
SystemParam
s allowed by disjoint access. - System parameter that works very much like
Query
except it always contains at least one matching entity. - Builder struct to create
QueryState
instances at runtime. - Shared borrow of an entity’s component with access to change detection. Similar to
Mut
but is immutable and so doesn’t require unique access. - A struct used to operate on reflected
Component
trait of a type. - A struct used to operate on the reflected
FromWorld
trait of a type. - A struct used to operate on reflected
Resource
of a type. - A
SystemParam
that yields entities that had theirT
Component
removed or have been despawned with it. - Shared borrow of a
Resource
. - Unique mutable borrow of a
Resource
. - A collection of systems, and the metadata and executor needed to run them in a certain order under certain conditions.
- System parameter that provides access to single entity’s components, much like
Query::single
/Query::single_mut
. - A wrapper over a
Bundle
indicating that an entity should be spawned with thatBundle
. This is intended to be used for hierarchical spawning via traits likeSpawnableList
andSpawnRelated
. - Type containing triggered
Event
information for a given run of anObserver
. This contains theEvent
data itself. If it was triggered for a specificEntity
, it includes that as well. It also contains event propagation information. SeeTrigger::propagate
for more information. - Filter that selects entities with a component
T
. - Filter that selects entities without a component
T
. - Stores and exposes operations on entities, components, resources, and their associated metadata.
Constants§
- apply_
deferred Deprecated SeeApplyDeferred
.
Traits§
- The
Bundle
trait enables insertion and removal ofComponent
s from an entity. - A
World
mutation. - A data type that can be used to store data for an entity.
- A system that determines if one or more scheduled systems should run.
- A trait for types that contain an
Entity
. - Types that can read change detection information. This change detection is controlled by
DetectChangesMut
types such asResMut
. - Types that implement reliable change detection.
- A command which gets executed for a given
Entity
. - Something that “happens” and might be read / observed by app logic.
- Creates an instance of the type this trait is implemented for using data from the supplied
World
. - Types that can convert into a
ScheduleConfigs
. - Conversion trait to turn something into a
System
. - Types that can be converted into a
SystemSet
. System
types that do not modify theWorld
when run. This is implemented for any systems whose parameters all implementReadOnlySystemParam
.- A
Component
containing the collection of entities that relate to thisEntity
via the associatedRelationship
type. See theRelationship
documentation for more information. - A type that can be inserted into a
World
as a singleton. - An ECS system that can be added to a
Schedule
- Trait for types that can be used as input to
System
s. - A builder that can create a
SystemParam
. - A trait implemented for all functions that can be used as
System
s. - Types that identify logical groups of systems.
Functions§
- A
Condition
-satisfying system that returnstrue
if there are any entity with a component of the given type removed. - A
Condition
-satisfying system that returnstrue
if there are any entities that match the givenQueryFilter
. - A
Condition
-satisfying system that returnstrue
if there are any entities with the given component type. - Generates a
Condition
that returns true when the passed one changes. - Generates a
Condition
that returns true when the result of the passed one went from false to true since the last time this was called. - Generates a
Condition
that inverses the result of passed one. - A
Condition
-satisfying system that returnstrue
if there are any new events of the given type since it was last called. - A
Condition
-satisfying system that returnstrue
if the resource of the given type has been added since the condition was last checked. - A
Condition
-satisfying system that returnstrue
if the resource of the given type has had its value changed since the condition was last checked. - A
Condition
-satisfying system that returnstrue
if the resource of the given type has had its value changed since the condition was last checked. - A
Condition
-satisfying system that returnstrue
if the resource exists. - A
Condition
-satisfying system that returnstrue
if the resource of the given type has had its value changed since the condition was last checked. - Generates a
Condition
-satisfying closure that returnstrue
if the resource exists and is equal tovalue
. - A
Condition
-satisfying system that returnstrue
if the resource of the given type has been removed since the condition was last checked. - A
Condition
-satisfying system that returnstrue
on the first time the condition is run and false every time after.
Type Aliases§
- A type alias over
RelatedSpawner
used to spawn child entities containing aChildOf
relationship. - A type alias over
RelatedSpawnerCommands
used to spawn child entities containing aChildOf
relationship. - A result type for use in fallible systems, commands and observers.
Derive Macros§
- Derive macro generating an impl of the trait
SystemSet
.