Expand description
Runtime reflection helpers built on top of bevy_reflect.
Modules§
- access
- Representation for individual element accesses within a path.
- attributes
- Types and functions for creating, manipulating and querying
CustomAttributes. - erased_
serde - github crates-io docs-rs
- prelude
- The reflect prelude.
- serde
- Serde integration for reflected types.
- std_
traits - Module containing the
ReflectDefaulttype. - utility
- Helpers for working with Bevy reflection.
Macros§
- hash_
error - Used to produce an error message when an attempt is made to hash
a
PartialReflectvalue that does not support hashing. - impl_
from_ reflect_ opaque - A macro used to generate a
FromReflecttrait 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
TypePathfor use on foreign types. - load_
type_ registrations - Collects and loads type registrations when using
auto_register_staticfeature.
Structs§
- Access
Error - An error originating from an
Accessof an element within a type. - Array
Info - A container for compile-time array info.
- Array
Iter - An iterator over an
Array. - Const
Param Info - Type information for a const generic parameter.
- Dynamic
Array - A fixed-size list of reflected values.
- Dynamic
Enum - A dynamic representation of an enum.
- Dynamic
List - A list of reflected values.
- Dynamic
Map - An unordered mapping between reflected values.
- Dynamic
Set - An unordered set of reflected values.
- Dynamic
Struct - A struct type which allows fields to be added at runtime.
- Dynamic
Tuple - A tuple which allows fields to be added at runtime.
- Dynamic
Tuple Struct - A tuple struct which allows fields to be added at runtime.
- Enum
Info - A container for compile-time enum info, used by
TypeInfo. - Field
Iter - An iterator over the field values of a struct.
- Generics
- The generic parameters of a type.
- List
Info - A container for compile-time list info.
- List
Iter - An iterator over an
List. - MapInfo
- A container for compile-time map info.
- Named
Field - The named field of a reflected struct.
- Offset
Access - An
Accesscombined with anoffsetfor more helpful error reporting. - Opaque
Info - A container for compile-time info related to reflection-opaque types, including primitives.
- Parse
Error - An error that occurs when parsing reflect path strings.
- Parsed
Path - A pre-parsed path to an element within a type.
- Reflect
Deserialize - A struct used to deserialize reflected instances of a type.
- Reflect
From Ptr Reflectvalues 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 implementsReflect, but have no way of turning it into a&dyn Reflect.- Reflect
From Reflect - Type data that represents the
FromReflecttrait and allows it to be used dynamically. - Reflect
Kind Mismatch Error - Caused when a type was expected to be of a certain kind, but was not.
- Reflect
Serialize - A struct used to serialize reflected instances of a type.
- SetInfo
- A container for compile-time set info.
- Struct
Info - A container for compile-time named struct info.
- Struct
Variant Info - Type info for struct variants.
- Tuple
Field Iter - An iterator over the field values of a tuple.
- Tuple
Info - A container for compile-time tuple info.
- Tuple
Struct Field Iter - An iterator over the field values of a tuple struct.
- Tuple
Struct Info - A container for compile-time tuple struct info.
- Tuple
Variant Info - Type info for tuple variants.
- Type
- The base representation of a Rust type.
- Type
Param Info - Type information for a generic type parameter.
- Type
Path Table - Provides dynamic access to all methods on
TypePath. - Type
Registration - Runtime storage for type metadata, registered into the
TypeRegistry. - Type
Registry - A registry of reflected types.
- Type
Registry Arc - A synchronized wrapper around a
TypeRegistry. - Unit
Variant Info - Type info for unit variants.
- Unnamed
Field - The unnamed field of a reflected tuple or tuple struct.
- Variant
Field Iter - An iterator over the fields in the current enum variant.
Enums§
- Access
- A singular element access within a path.
Multiple accesses can be combined into a
ParsedPath. - Access
Error Kind - The kind of
AccessError, along with some kind-specific information. - Apply
Error - A enumeration of all error outcomes that might happen when running
try_apply. - Dynamic
Variant - A dynamic representation of an enum variant.
- FieldId
- A representation of a field’s accessor.
- Generic
Info - An enum representing a generic parameter.
- Reflect
Clone Error - An error that occurs when cloning a type via
PartialReflect::reflect_clone. - Reflect
Kind - An enumeration of the “kinds” of a reflected type.
- Reflect
Mut - A mutable enumeration of “kinds” of a reflected type.
- Reflect
Owned - An owned enumeration of “kinds” of a reflected type.
- Reflect
Path Error - An error returned from a failed path string query.
- Reflect
Ref - An immutable enumeration of “kinds” of a reflected type.
- Type
Info - Compile-time type information for various reflected types.
- Type
Info Error - A
TypeInfo-specific error. - Variant
Field - A field in the current enum variant.
- Variant
Info - A container for compile-time enum variant info.
- Variant
Info Error - A
VariantInfo-specific error. - Variant
Type - Describes the form of an enum variant.
Traits§
- Array
- A trait used to power array-like operations via reflection.
- Dynamic
Type Path - Dynamic dispatch for
TypePath. - Dynamic
Typed - Dynamic dispatch for
Typed. - Enum
- A trait used to power enum-like operations via reflection.
- From
Reflect - A trait that enables types to be dynamically constructed from reflected data.
- From
Type - Trait used to generate
TypeDatafor trait reflection. - GetField
- A convenience trait which combines fetching and downcasting of struct fields.
- GetPath
- A trait which allows nested
Reflectvalues to be retrieved with path strings. - GetTuple
Field - A convenience trait which combines fetching and downcasting of tuple fields.
- GetTuple
Struct Field - A convenience trait which combines fetching and downcasting of tuple struct fields.
- GetType
Registration - A trait which allows a type to generate its
TypeRegistrationfor registration into theTypeRegistry. - Is
- Checks if the current type “is” another type, using a
TypeIdequality comparison. - List
- A trait used to power list-like operations via reflection.
- Map
- A trait used to power map-like operations via reflection.
- Partial
Reflect - 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. - Reflect
Path - Something that can be interpreted as a reflection path in
GetPath. - Reflect
Remote - Marks a type as a reflectable wrapper for a remote type.
- Reflect
Task Introspection - Runtime task-reflect contract exposed by generated Copper applications.
- Reflect
Type Path - 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.
- Tuple
Struct - A trait used to power tuple struct-like operations via reflection.
- Type
Data - A trait used to type-erase type metadata.
- Type
Path - A static accessor to type paths and names.
- Typed
- A static accessor to compile-time type information.
Functions§
- array_
apply - Applies the reflected array data to the given array.
- array_
debug - The default debug formatter for
Arraytypes. - array_
hash - Returns the
u64hash of the given array. - array_
partial_ eq - Compares two arrays (one concrete and one reflected) to see if they are equal.
- array_
try_ apply - Tries to apply the reflected array data to the given array and returns a Result.
- dump_
type_ registry_ schema - Dumps a stable, human-readable schema snapshot for the registered reflected types.
- enum_
debug - The default debug formatter for
Enumtypes. - enum_
hash - Returns the
u64hash of the given enum. - enum_
partial_ eq - Compares an
Enumwith aPartialReflectvalue. - list_
apply - Applies the elements of
bto the corresponding elements ofa. - list_
debug - The default debug formatter for
Listtypes. - list_
hash - Returns the
u64hash of the given list. - list_
partial_ eq - Compares a
Listwith aReflectvalue. - list_
try_ apply - Tries to apply the elements of
bto the corresponding elements ofaand returns a Result. - map_
apply - Applies the elements of reflected map
bto the corresponding elements of mapa. - map_
debug - The default debug formatter for
Maptypes. - map_
partial_ eq - Compares a
Mapwith aPartialReflectvalue. - map_
try_ apply - Tries to apply the elements of reflected map
bto the corresponding elements of mapaand returns a Result. - set_
apply - Applies the elements of reflected set
bto the corresponding elements of seta. - set_
debug - The default debug formatter for
Settypes. - set_
partial_ eq - Compares a
Setwith aPartialReflectvalue. - set_
try_ apply - Tries to apply the elements of reflected set
bto the corresponding elements of setaand returns a Result. - struct_
debug - The default debug formatter for
Structtypes. - struct_
partial_ eq - Compares a
Structwith aPartialReflectvalue. - tuple_
apply - Applies the elements of
bto the corresponding elements ofa. - tuple_
debug - The default debug formatter for
Tupletypes. - tuple_
partial_ eq - Compares a
Tuplewith aPartialReflectvalue. - tuple_
struct_ debug - The default debug formatter for
TupleStructtypes. - tuple_
struct_ partial_ eq - Compares a
TupleStructwith aPartialReflectvalue. - tuple_
try_ apply - Tries to apply the elements of
bto the corresponding elements ofaand returns a Result.
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§
- From
Reflect - Derives the
FromReflecttrait. - Reflect
- The main derive macro used by
bevy_reflectfor deriving itsReflecttrait. - Type
Path - Derives the
TypePathtrait, providing a stable alternative to [std::any::type_name].