Module component

Source
Expand description

Types for declaring and storing Components.

Structs§

ComponentDescriptor
A value describing a component or resource, which may or may not correspond to a Rust type.
ComponentHooks
World-mutating functions that run as part of lifecycle events of a Component.
ComponentId
A value which uniquely identifies the type of a Component or Resource within a World.
ComponentIdFor
A SystemParam that provides access to the ComponentId for a specific component type.
ComponentIds
Generates ComponentIds.
ComponentInfo
Stores metadata for a type of component or resource stored in a specific World.
ComponentTicks
Records when a component or resource was added and when it was last mutably dereferenced (or added).
Components
Stores metadata associated with each kind of Component in a given World.
ComponentsQueuedRegistrator
A type that enables queuing registration in Components.
ComponentsRegistrator
A Components wrapper that enables additional features, like registration.
HookContext
Context provided to a ComponentHook.
Immutable
Parameter indicating a Component is immutable.
Mutable
Parameter indicating a Component is mutable.
QueuedComponents
Allows queuing components to be registered.
RequiredComponent
Metadata associated with a required component. See Component for details.
RequiredComponentConstructor
A Required Component constructor. See Component for details.
RequiredComponents
The collection of metadata for components that are required for a given component.
Tick
A value that tracks when a system ran relative to other systems. This is used to power change detection.
TickCells
Interior-mutable access to the Ticks for a single component or resource.

Enums§

ComponentCloneBehavior
The clone behavior to use when cloning a Component.
RequiredComponentsError
An error returned when the registration of a required component fails.
StorageType
The storage used for a specific component type.

Traits§

Component
A data type that can be used to store data for an entity.
ComponentMutability
The mutability option for a Component. This can either be:

Functions§

component_clone_ignore
Noop implementation of component clone handler function.
component_clone_via_clone
Component clone handler function implemented using the Clone trait. Can be set as clone handler for the specific component it is implemented for. It will panic if set as handler for any other component.
component_clone_via_reflectbevy_reflect
Component clone handler function implemented using reflect. Can be set as clone handler for any registered component, but only reflected components will be cloned.

Type Aliases§

ComponentCloneFn
Function type that can be used to clone an entity.
ComponentHook
The type used for Component lifecycle hooks such as on_add, on_insert or on_remove.

Derive Macros§

Component