Module world

Expand description

Defines the World and APIs for accessing it directly.

Modules§

error
Contains error types returned by bevy’s schedule.
unsafe_world_cell
Contains types that allow disjoint mutable access to a World.

Structs§

CommandQueue
Densely and efficiently stores a queue of heterogenous types implementing Command.
DeferredWorld
A World reference that disallows structural ECS changes. This includes initializing resources, registering components or spawning entities.
EntityMut
Provides mutable access to a single entity and all of its components.
EntityRef
A read-only reference to a particular Entity and all of its components.
EntityWorldMut
A mutable reference to a particular Entity, and the entire world. This is essentially a performance-optimized (Entity, &mut World) tuple, which caches the EntityLocation to reduce duplicate lookups.
FilteredEntityMut
Provides mutable access to a single entity and some of its components defined by the contained Access.
FilteredEntityRef
Provides read-only access to a single entity and some of its components defined by the contained Access.
Mut
Unique mutable borrow of an entity’s component or of a resource.
OccupiedEntry
A view into an occupied entry in a EntityWorldMut. It is part of the Entry enum.
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.
Ref
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.
SpawnBatchIter
An iterator that spawns a series of entities and returns the ID of each spawned entity.
VacantEntry
A view into a vacant entry in a EntityWorldMut. It is part of the Entry enum.
World
Stores and exposes operations on entities, components, resources, and their associated metadata.
WorldId
A unique identifier for a World.

Enums§

Entry
A view into a single entity and component in a world, which may either be vacant or occupied.

Constants§

CHECK_TICK_THRESHOLD
The (arbitrarily chosen) minimum number of world tick increments between check_tick scans.
ON_ADD
Internal components used by bevy with a fixed component id. Constants are used to skip TypeId lookups in hot paths. ComponentId for OnAdd
ON_INSERT
ComponentId for OnInsert
ON_REMOVE
ComponentId for OnRemove

Traits§

Command
A World mutation.
FromWorld
Creates an instance of the type this trait is implemented for using data from the supplied World.