Module prelude
Expand description
Most commonly used re-exported types.
Structs§
- Added
- A filter on a component that only retains results the first time after they have been added.
- AnyOf
- The
AnyOfquery parameter fetches entities with any of the component types included in T. - AppType
Registry - A
Resourcestoring [TypeRegistry] for type registrations relevant to a whole app. - Changed
- A filter on a component that only retains results the first time after they have been added or mutably dereferenced.
- Commands
- A
Commandqueue to perform structural changes to theWorld. - Deferred
- A
SystemParamthat stores a buffer which gets applied to theWorldduringapply_deferred. This is used internally byCommandsto deferWorldmutations. - Entity
- Lightweight identifier of an entity.
- Entity
Mut - Provides mutable access to a single entity and all of its components.
- Entity
Ref - A read-only reference to a particular
Entityand all of its components. - Entity
World Mut - A mutable reference to a particular
Entity, and the entire world. This is essentially a performance-optimized(Entity, &mut World)tuple, which caches theEntityLocationto reduce duplicate lookups. - Event
Reader - Reads events of type
Tin order and tracks which events have already been read. - Event
Writer - Sends events of type
T. - Events
- An event collection that represents the events that occurred within the last two
Events::updatecalls. Events can be written to using anEventWriterand are typically cheaply read using anEventReader. - Has
- Returns a bool that describes if an entity has the component
T. - In
- Wrapper type to mark a
SystemParamas an input. - Local
- A system local
SystemParam. - Mut
- Unique mutable borrow of an entity’s component or of a resource.
- NonSend
- Shared borrow of a non-
Sendresource. - NonSend
Mut - Unique borrow of a non-
Sendresource. - Observer
- An
Observersystem. Add thisComponentto anEntityto turn it into an “observer”. - OnAdd
- Trigger emitted when a component is added to an entity.
- OnInsert
- Trigger emitted when a component is inserted on to to an entity.
- OnRemove
- Trigger emitted when a component is removed from an entity.
- Or
- A filter that tests if any of the given filters apply.
- Parallel
Commands - An alternative to
Commandsthat can be used in parallel contexts, such as those inQuery::par_iter - Param
Set - A collection of potentially conflicting
SystemParams allowed by disjoint access. - Query
- System parameter that provides selective access to the
Componentdata stored in aWorld. - Query
Builder - Builder struct to create
QueryStateinstances at runtime. - Query
State - Provides scoped access to a
Worldstate according to a givenQueryDataandQueryFilter. - Ref
- Shared borrow of an entity’s component with access to change detection.
Similar to
Mutbut is immutable and so doesn’t require unique access. - Reflect
Component - A struct used to operate on reflected
Componenttrait of a type. - Reflect
From World - A struct used to operate on the reflected
FromWorldtrait of a type. - Reflect
Resource - A struct used to operate on reflected
Resourceof a type. - Removed
Components - A
SystemParamthat yields entities that had theirTComponentremoved or have been despawned with it. - Res
- Shared borrow of a
Resource. - ResMut
- Unique mutable borrow of a
Resource. - Schedule
- A collection of systems, and the metadata and executor needed to run them in a certain order under certain conditions.
- Schedules
- Resource that stores
Schedules mapped toScheduleLabels excluding the current runningSchedule. - System
Builder - Builder struct used to construct state for
SystemParampassed to a system. - Trigger
- Type containing triggered
Eventinformation for a given run of anObserver. This contains theEventdata itself. If it was triggered for a specificEntity, it includes that as well. - With
- Filter that selects entities with a component
T. - Without
- Filter that selects entities without a component
T. - World
- Stores and exposes operations on entities, components, resources, and their associated metadata.
Enums§
- Should
Update Events - Controls whether or not the events in an
EventRegistryshould be updated.
Traits§
- Bundle
- The
Bundletrait enables insertion and removal ofComponents from an entity. - Component
- A data type that can be used to store data for an entity.
- Condition
- A system that determines if one or more scheduled systems should run.
- Detect
Changes - Types that can read change detection information.
This change detection is controlled by
DetectChangesMuttypes such asResMut. - Detect
Changes Mut - Types that implement reliable change detection.
- Entity
Mapper - An implementor of this trait knows how to map an
Entityinto anotherEntity. - Event
- Something that “happens” and might be read / observed by app logic.
- From
World - Creates an instance of the type this trait is implemented for
using data from the supplied
World. - Into
System - Conversion trait to turn something into a
System. - Into
System Configs - Types that can convert into a
SystemConfigs. - Into
System Set - Types that can be converted into a
SystemSet. - Into
System SetConfigs - Types that can convert into a
SystemSetConfigs. - Read
Only System Systemtypes that do not modify theWorldwhen run. This is implemented for any systems whose parameters all implementReadOnlySystemParam.- Resource
- A type that can be inserted into a
Worldas a singleton. - System
- An ECS system that can be added to a
Schedule - System
Param Function - A trait implemented for all functions that can be used as
Systems. - System
Set - Types that identify logical groups of systems.
Functions§
- any_
component_ removed - Generates a
Condition-satisfying closure that returnstrueif there are any entity with a component of the given type removed. - any_
with_ component - A
Condition-satisfying system that returnstrueif there are any entities with the given component type. - apply_
deferred - Instructs the executor to call
System::apply_deferredon the systems that have run but not applied theirDeferredsystem parameters (likeCommands) or other system buffers. - not
- Generates a
Conditionthat inverses the result of passed one. - on_
event - Generates a
Condition-satisfying closure that returnstrueif there are any new events of the given type since it was last called. - resource_
added - A
Condition-satisfying system that returnstrueif the resource of the given type has been added since the condition was last checked. - resource_
changed - A
Condition-satisfying system that returnstrueif the resource of the given type has had its value changed since the condition was last checked. - resource_
changed_ or_ removed - Generates a
Condition-satisfying closure that returnstrueif the resource of the given type has had its value changed since the condition was last checked. - resource_
equals - Generates a
Condition-satisfying closure that returnstrueif the resource is equal tovalue. - resource_
exists - A
Condition-satisfying system that returnstrueif the resource exists. - resource_
exists_ and_ changed - A
Condition-satisfying system that returnstrueif the resource of the given type has had its value changed since the condition was last checked. - resource_
exists_ and_ equals - Generates a
Condition-satisfying closure that returnstrueif the resource exists and is equal tovalue. - resource_
removed - Generates a
Condition-satisfying closure that returnstrueif the resource of the given type has been removed since the condition was last checked. - run_
once - Generates a
Condition-satisfying closure that returnstrueif the first time the condition is run and false every time after