Trait bevy_reflect::GetTypeRegistration
source · pub trait GetTypeRegistration: 'static {
// Required method
fn get_type_registration() -> TypeRegistration;
// Provided method
fn register_type_dependencies(registry: &mut TypeRegistry) { ... }
}
Expand description
A trait which allows a type to generate its TypeRegistration
for registration into the TypeRegistry
.
This trait is automatically implemented for items using #[derive(Reflect)]
.
The macro also allows TypeData
to be more easily registered.
See the crate-level documentation for more information on type registration.
Required Methods§
sourcefn get_type_registration() -> TypeRegistration
fn get_type_registration() -> TypeRegistration
Returns the default TypeRegistration
for this type.
Provided Methods§
sourcefn register_type_dependencies(registry: &mut TypeRegistry)
fn register_type_dependencies(registry: &mut TypeRegistry)
Registers other types needed by this type.
This method is called by TypeRegistry::register
to register any other required types.
Often, this is done for fields of structs and enum variants to ensure all types are properly registered.
Object Safety§
This trait is not object safe.