Skip to main content

Module reflect

Module reflect 

Source
Expand description

Runtime reflection helpers built on top of bevy_reflect.

Modules§

access
Representation for individual element accesses within a path.
array
Traits and types used to power array-like operations via reflection.
attributes
Types and functions for creating, manipulating and querying CustomAttributes.
convert
The ReflectConvert type, which allows types to register conversions to and from one another.
enums
Traits and types used to power enum-like operations via reflection.
erased_serde
githubcrates-iodocs-rs
list
Traits and types used to power list-like operations via reflection.
map
Traits and types used to power map-like operations via reflection.
prelude
The reflect prelude.
serde
Serde integration for reflected types.
set
A trait used to power set-like operations via reflection.
std_traits
Module containing the ReflectDefault type.
structs
Traits and types used to power struct-like operations via reflection.
tuple
Traits and types used to power tuple-like operations via reflection.
tuple_struct
Traits and types used to power tuple-struct-like operations via reflection.
utility
Helpers for working with Bevy reflection.

Macros§

hash_error
Used to produce an error message when an attempt is made to hash a PartialReflect value that does not support hashing.
impl_from_reflect_opaque
A macro used to generate a FromReflect trait implementation for the given type.
impl_reflect
A replacement for #[derive(Reflect)] to be used with foreign types which the definitions of cannot be altered.
impl_reflect_opaque
A macro used to generate reflection trait implementations for the given type.
impl_type_path
A replacement for deriving TypePath for use on foreign types.
load_type_registrations
Collects and loads type registrations when using auto_register_static feature.

Structs§

AccessError
An error originating from an Access of an element within a type.
ArrayInfo
A container for compile-time array info.
ConstParamInfo
Type information for a const generic parameter.
EnumInfo
A container for compile-time enum info, used by TypeInfo.
Generics
The generic parameters of a type.
ListInfo
A container for compile-time list info.
MapInfo
A container for compile-time map info.
NamedField
The named field of a reflected struct.
OffsetAccess
An Access combined with an offset for more helpful error reporting.
OpaqueInfo
A container for compile-time info related to reflection-opaque types, including primitives.
ParseError
An error that occurs when parsing reflect path strings.
ParsedPath
A pre-parsed path to an element within a type.
ReflectDeserialize
A struct used to deserialize reflected instances of a type.
ReflectFromPtr
Reflect values are commonly used in situations where the actual types of values are not known at runtime. In such situations you might have access to a *const () pointer that you know implements Reflect, but have no way of turning it into a &dyn Reflect.
ReflectFromReflect
Type data that represents the FromReflect trait and allows it to be used dynamically.
ReflectKindMismatchError
Caused when a type was expected to be of a certain kind, but was not.
ReflectSerialize
A struct used to serialize reflected instances of a type.
SetInfo
A container for compile-time set info.
StructInfo
A container for compile-time named struct info.
TupleInfo
A container for compile-time tuple info.
TupleStructInfo
A container for compile-time tuple struct info.
Type
The base representation of a Rust type.
TypeParamInfo
Type information for a generic type parameter.
TypePathTable
Provides dynamic access to all methods on TypePath.
TypeRegistration
Runtime storage for type metadata, registered into the TypeRegistry.
TypeRegistry
A registry of reflected types.
TypeRegistryArc
A synchronized wrapper around a TypeRegistry.
UnnamedField
The unnamed field of a reflected tuple or tuple struct.

Enums§

Access
A singular element access within a path. Multiple accesses can be combined into a ParsedPath.
AccessErrorKind
The kind of AccessError, along with some kind-specific information.
ApplyError
A enumeration of all error outcomes that might happen when running try_apply.
FieldId
A representation of a field’s accessor.
GenericInfo
An enum representing a generic parameter.
ReflectCloneError
An error that occurs when cloning a type via PartialReflect::reflect_clone.
ReflectKind
An enumeration of the “kinds” of a reflected type.
ReflectMut
A mutable enumeration of “kinds” of a reflected type.
ReflectOwned
An owned enumeration of “kinds” of a reflected type.
ReflectPathError
An error returned from a failed path string query.
ReflectRef
An immutable enumeration of “kinds” of a reflected type.
TypeInfo
Compile-time type information for various reflected types.
TypeInfoError
A TypeInfo-specific error.
VariantInfo
A container for compile-time enum variant info.
VariantType
Describes the form of an enum variant.

Traits§

Array
A trait used to power array-like operations via reflection.
DynamicTypePath
Dynamic dispatch for TypePath.
DynamicTyped
Dynamic dispatch for Typed.
Enum
A trait used to power enum-like operations via reflection.
FromReflect
A trait that enables types to be dynamically constructed from reflected data.
FromType
Trait used to generate TypeData for trait reflection.
GetPath
A trait which allows nested Reflect values to be retrieved with path strings.
GetTypeRegistration
A trait which allows a type to generate its TypeRegistration for registration into the TypeRegistry.
Is
Checks if the current type “is” another type, using a TypeId equality comparison.
List
A trait used to power list-like operations via reflection.
Map
A trait used to power map-like operations via reflection.
PartialReflect
The foundational trait of bevy_reflect, used for accessing and modifying data dynamically.
Reflect
A core trait of bevy_reflect, used for downcasting to concrete types.
ReflectPath
Something that can be interpreted as a reflection path in GetPath.
ReflectRemote
Marks a type as a reflectable wrapper for a remote type.
ReflectTaskIntrospection
Runtime task-reflect contract exposed by generated Copper applications.
ReflectTypePath
Reflectable
A catch-all trait that is bound by the core reflection traits, useful to simplify reflection-based generic type bounds.
Set
A trait used to power set-like operations via reflection.
Struct
A trait used to power struct-like operations via reflection.
Tuple
A trait used to power tuple-like operations via reflection.
TupleStruct
A trait used to power tuple struct-like operations via reflection.
TypeData
A trait used to type-erase type metadata.
TypePath
A static accessor to type paths and names.
Typed
A static accessor to compile-time type information.

Functions§

dump_type_registry_schema
Dumps a stable, human-readable schema snapshot for the registered reflected types.

Attribute Macros§

reflect_remote
Generates a wrapper type that can be used to “derive Reflect” for remote types.
reflect_trait
A macro that automatically generates type data for traits, which their implementors can then register.

Derive Macros§

FromReflect
Derives the FromReflect trait.
Reflect
The main derive macro used by bevy_reflect for deriving its Reflect trait.
TypePath
Derives the TypePath trait, providing a stable alternative to [std::any::type_name].