bevy_reflect

Trait 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.

If you need to use this trait as a generic bound along with other reflection traits, for your convenience, consider using Reflectable instead.

See the crate-level documentation for more information on type registration.

Required Methods§

source

fn get_type_registration() -> TypeRegistration

Returns the default TypeRegistration for this type.

Provided Methods§

source

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.

Implementations on Foreign Types§

source§

impl GetTypeRegistration for &'static str

source§

impl GetTypeRegistration for &'static Path

source§

impl GetTypeRegistration for EulerRot
where EulerRot: Any + Send + Sync,

source§

impl GetTypeRegistration for Cow<'static, str>

source§

impl GetTypeRegistration for Cow<'static, Path>

source§

impl GetTypeRegistration for bool
where bool: Any + Send + Sync,

source§

impl GetTypeRegistration for char
where char: Any + Send + Sync,

source§

impl GetTypeRegistration for f32
where f32: Any + Send + Sync,

source§

impl GetTypeRegistration for f64
where f64: Any + Send + Sync,

source§

impl GetTypeRegistration for i8
where i8: Any + Send + Sync,

source§

impl GetTypeRegistration for i16
where i16: Any + Send + Sync,

source§

impl GetTypeRegistration for i32
where i32: Any + Send + Sync,

source§

impl GetTypeRegistration for i64
where i64: Any + Send + Sync,

source§

impl GetTypeRegistration for i128
where i128: Any + Send + Sync,

source§

impl GetTypeRegistration for isize
where isize: Any + Send + Sync,

source§

impl GetTypeRegistration for u8
where u8: Any + Send + Sync,

source§

impl GetTypeRegistration for u16
where u16: Any + Send + Sync,

source§

impl GetTypeRegistration for u32
where u32: Any + Send + Sync,

source§

impl GetTypeRegistration for u64
where u64: Any + Send + Sync,

source§

impl GetTypeRegistration for u128
where u128: Any + Send + Sync,

source§

impl GetTypeRegistration for ()

source§

impl GetTypeRegistration for usize
where usize: Any + Send + Sync,

source§

impl GetTypeRegistration for BVec2
where BVec2: Any + Send + Sync, bool: FromReflect + TypePath + MaybeTyped + RegisterForReflection,

source§

impl GetTypeRegistration for BVec3
where BVec3: Any + Send + Sync, bool: FromReflect + TypePath + MaybeTyped + RegisterForReflection,

source§

impl GetTypeRegistration for BVec4
where BVec4: Any + Send + Sync, bool: FromReflect + TypePath + MaybeTyped + RegisterForReflection,

source§

impl GetTypeRegistration for BVec3A
where BVec3A: Any + Send + Sync,

source§

impl GetTypeRegistration for BVec4A
where BVec4A: Any + Send + Sync,

source§

impl GetTypeRegistration for Affine2
where Affine2: Any + Send + Sync, Mat2: FromReflect + TypePath + MaybeTyped + RegisterForReflection, Vec2: FromReflect + TypePath + MaybeTyped + RegisterForReflection,

source§

impl GetTypeRegistration for Affine3A
where Affine3A: Any + Send + Sync, Mat3A: FromReflect + TypePath + MaybeTyped + RegisterForReflection, Vec3A: FromReflect + TypePath + MaybeTyped + RegisterForReflection,

source§

impl GetTypeRegistration for Mat3
where Mat3: Any + Send + Sync, Vec3: FromReflect + TypePath + MaybeTyped + RegisterForReflection,

source§

impl GetTypeRegistration for Mat2
where Mat2: Any + Send + Sync, Vec2: FromReflect + TypePath + MaybeTyped + RegisterForReflection,

source§

impl GetTypeRegistration for Mat3A
where Mat3A: Any + Send + Sync, Vec3A: FromReflect + TypePath + MaybeTyped + RegisterForReflection,

source§

impl GetTypeRegistration for Mat4
where Mat4: Any + Send + Sync, Vec4: FromReflect + TypePath + MaybeTyped + RegisterForReflection,

source§

impl GetTypeRegistration for Quat
where Quat: Any + Send + Sync, f32: FromReflect + TypePath + MaybeTyped + RegisterForReflection,

source§

impl GetTypeRegistration for Vec3A
where Vec3A: Any + Send + Sync, f32: FromReflect + TypePath + MaybeTyped + RegisterForReflection,

source§

impl GetTypeRegistration for Vec4
where Vec4: Any + Send + Sync, f32: FromReflect + TypePath + MaybeTyped + RegisterForReflection,

source§

impl GetTypeRegistration for Vec2
where Vec2: Any + Send + Sync, f32: FromReflect + TypePath + MaybeTyped + RegisterForReflection,

source§

impl GetTypeRegistration for Vec3
where Vec3: Any + Send + Sync, f32: FromReflect + TypePath + MaybeTyped + RegisterForReflection,

source§

impl GetTypeRegistration for DAffine2
where DAffine2: Any + Send + Sync, DMat2: FromReflect + TypePath + MaybeTyped + RegisterForReflection, DVec2: FromReflect + TypePath + MaybeTyped + RegisterForReflection,

source§

impl GetTypeRegistration for DAffine3
where DAffine3: Any + Send + Sync, DMat3: FromReflect + TypePath + MaybeTyped + RegisterForReflection, DVec3: FromReflect + TypePath + MaybeTyped + RegisterForReflection,

source§

impl GetTypeRegistration for DMat2
where DMat2: Any + Send + Sync, DVec2: FromReflect + TypePath + MaybeTyped + RegisterForReflection,

source§

impl GetTypeRegistration for DMat3
where DMat3: Any + Send + Sync, DVec3: FromReflect + TypePath + MaybeTyped + RegisterForReflection,

source§

impl GetTypeRegistration for DMat4
where DMat4: Any + Send + Sync, DVec4: FromReflect + TypePath + MaybeTyped + RegisterForReflection,

source§

impl GetTypeRegistration for DQuat
where DQuat: Any + Send + Sync, f64: FromReflect + TypePath + MaybeTyped + RegisterForReflection,

source§

impl GetTypeRegistration for DVec2
where DVec2: Any + Send + Sync, f64: FromReflect + TypePath + MaybeTyped + RegisterForReflection,

source§

impl GetTypeRegistration for DVec3
where DVec3: Any + Send + Sync, f64: FromReflect + TypePath + MaybeTyped + RegisterForReflection,

source§

impl GetTypeRegistration for DVec4
where DVec4: Any + Send + Sync, f64: FromReflect + TypePath + MaybeTyped + RegisterForReflection,

source§

impl GetTypeRegistration for IVec2
where IVec2: Any + Send + Sync, i32: FromReflect + TypePath + MaybeTyped + RegisterForReflection,

source§

impl GetTypeRegistration for IVec3
where IVec3: Any + Send + Sync, i32: FromReflect + TypePath + MaybeTyped + RegisterForReflection,

source§

impl GetTypeRegistration for IVec4
where IVec4: Any + Send + Sync, i32: FromReflect + TypePath + MaybeTyped + RegisterForReflection,

source§

impl GetTypeRegistration for I64Vec2
where I64Vec2: Any + Send + Sync, i64: FromReflect + TypePath + MaybeTyped + RegisterForReflection,

source§

impl GetTypeRegistration for I64Vec3
where I64Vec3: Any + Send + Sync, i64: FromReflect + TypePath + MaybeTyped + RegisterForReflection,

source§

impl GetTypeRegistration for I64Vec4
where I64Vec4: Any + Send + Sync, i64: FromReflect + TypePath + MaybeTyped + RegisterForReflection,

source§

impl GetTypeRegistration for UVec2
where UVec2: Any + Send + Sync, u32: FromReflect + TypePath + MaybeTyped + RegisterForReflection,

source§

impl GetTypeRegistration for UVec3
where UVec3: Any + Send + Sync, u32: FromReflect + TypePath + MaybeTyped + RegisterForReflection,

source§

impl GetTypeRegistration for UVec4
where UVec4: Any + Send + Sync, u32: FromReflect + TypePath + MaybeTyped + RegisterForReflection,

source§

impl GetTypeRegistration for U64Vec2
where U64Vec2: Any + Send + Sync, u64: FromReflect + TypePath + MaybeTyped + RegisterForReflection,

source§

impl GetTypeRegistration for U64Vec3
where U64Vec3: Any + Send + Sync, u64: FromReflect + TypePath + MaybeTyped + RegisterForReflection,

source§

impl GetTypeRegistration for U64Vec4
where U64Vec4: Any + Send + Sync, u64: FromReflect + TypePath + MaybeTyped + RegisterForReflection,

source§

impl GetTypeRegistration for SmolStr
where SmolStr: Any + Send + Sync,

source§

impl GetTypeRegistration for Uuid
where Uuid: Any + Send + Sync,

source§

impl GetTypeRegistration for String
where String: Any + Send + Sync,

source§

impl GetTypeRegistration for TypeId
where TypeId: Any + Send + Sync,

source§

impl GetTypeRegistration for RangeFull
where RangeFull: Any + Send + Sync,

source§

impl GetTypeRegistration for AtomicBool
where AtomicBool: Any + Send + Sync,

source§

impl GetTypeRegistration for AtomicI8
where AtomicI8: Any + Send + Sync,

source§

impl GetTypeRegistration for AtomicI16
where AtomicI16: Any + Send + Sync,

source§

impl GetTypeRegistration for AtomicI32
where AtomicI32: Any + Send + Sync,

source§

impl GetTypeRegistration for AtomicI64
where AtomicI64: Any + Send + Sync,

source§

impl GetTypeRegistration for AtomicIsize
where AtomicIsize: Any + Send + Sync,

source§

impl GetTypeRegistration for AtomicU8
where AtomicU8: Any + Send + Sync,

source§

impl GetTypeRegistration for AtomicU16
where AtomicU16: Any + Send + Sync,

source§

impl GetTypeRegistration for AtomicU32
where AtomicU32: Any + Send + Sync,

source§

impl GetTypeRegistration for AtomicU64
where AtomicU64: Any + Send + Sync,

source§

impl GetTypeRegistration for AtomicUsize
where AtomicUsize: Any + Send + Sync,

source§

impl GetTypeRegistration for Duration
where Duration: Any + Send + Sync,

source§

impl GetTypeRegistration for OsString
where OsString: Any + Send + Sync,

source§

impl GetTypeRegistration for PathBuf
where PathBuf: Any + Send + Sync,

source§

impl GetTypeRegistration for Instant
where Instant: Any + Send + Sync,

source§

impl GetTypeRegistration for NonZeroI8
where NonZeroI8: Any + Send + Sync,

source§

impl GetTypeRegistration for NonZeroI16
where NonZeroI16: Any + Send + Sync,

source§

impl GetTypeRegistration for NonZeroI32
where NonZeroI32: Any + Send + Sync,

source§

impl GetTypeRegistration for NonZeroI64
where NonZeroI64: Any + Send + Sync,

source§

impl GetTypeRegistration for NonZeroI128
where NonZeroI128: Any + Send + Sync,

source§

impl GetTypeRegistration for NonZeroIsize

source§

impl GetTypeRegistration for NonZeroU8
where NonZeroU8: Any + Send + Sync,

source§

impl GetTypeRegistration for NonZeroU16
where NonZeroU16: Any + Send + Sync,

source§

impl GetTypeRegistration for NonZeroU32
where NonZeroU32: Any + Send + Sync,

source§

impl GetTypeRegistration for NonZeroU64
where NonZeroU64: Any + Send + Sync,

source§

impl GetTypeRegistration for NonZeroU128
where NonZeroU128: Any + Send + Sync,

source§

impl GetTypeRegistration for NonZeroUsize

source§

impl<A: Reflect + MaybeTyped + TypePath + GetTypeRegistration> GetTypeRegistration for (A,)

source§

impl<A: Reflect + MaybeTyped + TypePath + GetTypeRegistration, B: Reflect + MaybeTyped + TypePath + GetTypeRegistration> GetTypeRegistration for (A, B)

source§

impl<A: Reflect + MaybeTyped + TypePath + GetTypeRegistration, B: Reflect + MaybeTyped + TypePath + GetTypeRegistration, C: Reflect + MaybeTyped + TypePath + GetTypeRegistration> GetTypeRegistration for (A, B, C)

source§

impl<A: Reflect + MaybeTyped + TypePath + GetTypeRegistration, B: Reflect + MaybeTyped + TypePath + GetTypeRegistration, C: Reflect + MaybeTyped + TypePath + GetTypeRegistration, D: Reflect + MaybeTyped + TypePath + GetTypeRegistration> GetTypeRegistration for (A, B, C, D)

source§

impl<A: Reflect + MaybeTyped + TypePath + GetTypeRegistration, B: Reflect + MaybeTyped + TypePath + GetTypeRegistration, C: Reflect + MaybeTyped + TypePath + GetTypeRegistration, D: Reflect + MaybeTyped + TypePath + GetTypeRegistration, E: Reflect + MaybeTyped + TypePath + GetTypeRegistration> GetTypeRegistration for (A, B, C, D, E)

source§

impl<A: Reflect + MaybeTyped + TypePath + GetTypeRegistration, B: Reflect + MaybeTyped + TypePath + GetTypeRegistration, C: Reflect + MaybeTyped + TypePath + GetTypeRegistration, D: Reflect + MaybeTyped + TypePath + GetTypeRegistration, E: Reflect + MaybeTyped + TypePath + GetTypeRegistration, F: Reflect + MaybeTyped + TypePath + GetTypeRegistration> GetTypeRegistration for (A, B, C, D, E, F)

source§

impl<A: Reflect + MaybeTyped + TypePath + GetTypeRegistration, B: Reflect + MaybeTyped + TypePath + GetTypeRegistration, C: Reflect + MaybeTyped + TypePath + GetTypeRegistration, D: Reflect + MaybeTyped + TypePath + GetTypeRegistration, E: Reflect + MaybeTyped + TypePath + GetTypeRegistration, F: Reflect + MaybeTyped + TypePath + GetTypeRegistration, G: Reflect + MaybeTyped + TypePath + GetTypeRegistration> GetTypeRegistration for (A, B, C, D, E, F, G)

source§

impl<A: Reflect + MaybeTyped + TypePath + GetTypeRegistration, B: Reflect + MaybeTyped + TypePath + GetTypeRegistration, C: Reflect + MaybeTyped + TypePath + GetTypeRegistration, D: Reflect + MaybeTyped + TypePath + GetTypeRegistration, E: Reflect + MaybeTyped + TypePath + GetTypeRegistration, F: Reflect + MaybeTyped + TypePath + GetTypeRegistration, G: Reflect + MaybeTyped + TypePath + GetTypeRegistration, H: Reflect + MaybeTyped + TypePath + GetTypeRegistration> GetTypeRegistration for (A, B, C, D, E, F, G, H)

source§

impl<A: Reflect + MaybeTyped + TypePath + GetTypeRegistration, B: Reflect + MaybeTyped + TypePath + GetTypeRegistration, C: Reflect + MaybeTyped + TypePath + GetTypeRegistration, D: Reflect + MaybeTyped + TypePath + GetTypeRegistration, E: Reflect + MaybeTyped + TypePath + GetTypeRegistration, F: Reflect + MaybeTyped + TypePath + GetTypeRegistration, G: Reflect + MaybeTyped + TypePath + GetTypeRegistration, H: Reflect + MaybeTyped + TypePath + GetTypeRegistration, I: Reflect + MaybeTyped + TypePath + GetTypeRegistration> GetTypeRegistration for (A, B, C, D, E, F, G, H, I)

source§

impl<A: Reflect + MaybeTyped + TypePath + GetTypeRegistration, B: Reflect + MaybeTyped + TypePath + GetTypeRegistration, C: Reflect + MaybeTyped + TypePath + GetTypeRegistration, D: Reflect + MaybeTyped + TypePath + GetTypeRegistration, E: Reflect + MaybeTyped + TypePath + GetTypeRegistration, F: Reflect + MaybeTyped + TypePath + GetTypeRegistration, G: Reflect + MaybeTyped + TypePath + GetTypeRegistration, H: Reflect + MaybeTyped + TypePath + GetTypeRegistration, I: Reflect + MaybeTyped + TypePath + GetTypeRegistration, J: Reflect + MaybeTyped + TypePath + GetTypeRegistration> GetTypeRegistration for (A, B, C, D, E, F, G, H, I, J)

source§

impl<A: Reflect + MaybeTyped + TypePath + GetTypeRegistration, B: Reflect + MaybeTyped + TypePath + GetTypeRegistration, C: Reflect + MaybeTyped + TypePath + GetTypeRegistration, D: Reflect + MaybeTyped + TypePath + GetTypeRegistration, E: Reflect + MaybeTyped + TypePath + GetTypeRegistration, F: Reflect + MaybeTyped + TypePath + GetTypeRegistration, G: Reflect + MaybeTyped + TypePath + GetTypeRegistration, H: Reflect + MaybeTyped + TypePath + GetTypeRegistration, I: Reflect + MaybeTyped + TypePath + GetTypeRegistration, J: Reflect + MaybeTyped + TypePath + GetTypeRegistration, K: Reflect + MaybeTyped + TypePath + GetTypeRegistration> GetTypeRegistration for (A, B, C, D, E, F, G, H, I, J, K)

source§

impl<A: Reflect + MaybeTyped + TypePath + GetTypeRegistration, B: Reflect + MaybeTyped + TypePath + GetTypeRegistration, C: Reflect + MaybeTyped + TypePath + GetTypeRegistration, D: Reflect + MaybeTyped + TypePath + GetTypeRegistration, E: Reflect + MaybeTyped + TypePath + GetTypeRegistration, F: Reflect + MaybeTyped + TypePath + GetTypeRegistration, G: Reflect + MaybeTyped + TypePath + GetTypeRegistration, H: Reflect + MaybeTyped + TypePath + GetTypeRegistration, I: Reflect + MaybeTyped + TypePath + GetTypeRegistration, J: Reflect + MaybeTyped + TypePath + GetTypeRegistration, K: Reflect + MaybeTyped + TypePath + GetTypeRegistration, L: Reflect + MaybeTyped + TypePath + GetTypeRegistration> GetTypeRegistration for (A, B, C, D, E, F, G, H, I, J, K, L)

source§

impl<K, V> GetTypeRegistration for BTreeMap<K, V>
where K: FromReflect + MaybeTyped + TypePath + GetTypeRegistration + Eq + Ord, V: FromReflect + MaybeTyped + TypePath + GetTypeRegistration,

source§

impl<K, V, S> GetTypeRegistration for HashMap<K, V, S>
where K: FromReflect + MaybeTyped + TypePath + GetTypeRegistration + Eq + Hash, V: FromReflect + MaybeTyped + TypePath + GetTypeRegistration, S: TypePath + BuildHasher + Send + Sync,

source§

impl<K, V, S> GetTypeRegistration for HashMap<K, V, S>
where K: FromReflect + MaybeTyped + TypePath + GetTypeRegistration + Eq + Hash, V: FromReflect + MaybeTyped + TypePath + GetTypeRegistration, S: TypePath + BuildHasher + Send + Sync,

source§

impl<T> GetTypeRegistration for Bound<T>
where Bound<T>: Any + Send + Sync, T: TypePath + Clone + Send + Sync,

source§

impl<T> GetTypeRegistration for Option<T>
where Option<T>: Any + Send + Sync, T: TypePath + FromReflect + MaybeTyped + RegisterForReflection,

source§

impl<T> GetTypeRegistration for BinaryHeap<T>
where BinaryHeap<T>: Any + Send + Sync, T: TypePath + Clone,

source§

impl<T> GetTypeRegistration for BTreeSet<T>
where BTreeSet<T>: Any + Send + Sync, T: TypePath + Ord + Eq + Clone + Send + Sync,

source§

impl<T> GetTypeRegistration for Arc<T>
where Arc<T>: Any + Send + Sync, T: TypePath + Send + Sync + ?Sized,

source§

impl<T> GetTypeRegistration for Saturating<T>
where Saturating<T>: Any + Send + Sync, T: TypePath + Clone + Send + Sync,

source§

impl<T> GetTypeRegistration for Wrapping<T>
where Wrapping<T>: Any + Send + Sync, T: TypePath + Clone + Send + Sync,

source§

impl<T> GetTypeRegistration for Range<T>
where Range<T>: Any + Send + Sync, T: TypePath + Clone + Send + Sync,

source§

impl<T> GetTypeRegistration for RangeFrom<T>
where RangeFrom<T>: Any + Send + Sync, T: TypePath + Clone + Send + Sync,

source§

impl<T> GetTypeRegistration for RangeInclusive<T>
where RangeInclusive<T>: Any + Send + Sync, T: TypePath + Clone + Send + Sync,

source§

impl<T> GetTypeRegistration for RangeTo<T>
where RangeTo<T>: Any + Send + Sync, T: TypePath + Clone + Send + Sync,

source§

impl<T> GetTypeRegistration for RangeToInclusive<T>
where RangeToInclusive<T>: Any + Send + Sync, T: TypePath + Clone + Send + Sync,

source§

impl<T, E> GetTypeRegistration for Result<T, E>
where Result<T, E>: Any + Send + Sync, T: TypePath + FromReflect + MaybeTyped + RegisterForReflection, E: TypePath + FromReflect + MaybeTyped + RegisterForReflection,

source§

impl<T: SmallArray + TypePath + Send + Sync> GetTypeRegistration for SmallVec<T>
where T::Item: FromReflect + MaybeTyped + TypePath,

source§

impl<T: FromReflect + MaybeTyped + Clone + TypePath + GetTypeRegistration> GetTypeRegistration for Cow<'static, [T]>

source§

impl<T: FromReflect + MaybeTyped + TypePath + GetTypeRegistration> GetTypeRegistration for VecDeque<T>

source§

impl<T: FromReflect + MaybeTyped + TypePath + GetTypeRegistration> GetTypeRegistration for Vec<T>

source§

impl<T: Reflect + MaybeTyped + TypePath + GetTypeRegistration, const N: usize> GetTypeRegistration for [T; N]

source§

impl<V, S> GetTypeRegistration for HashSet<V, S>

source§

impl<V, S> GetTypeRegistration for HashSet<V, S>

Implementors§