Skip to main content

GetTypeRegistration

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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl GetTypeRegistration for &'static str

Source§

impl GetTypeRegistration for &'static Location<'static>

Source§

impl GetTypeRegistration for &'static Path

Source§

impl GetTypeRegistration for Cow<'static, str>

Source§

impl GetTypeRegistration for Cow<'static, Path>

Source§

impl GetTypeRegistration for SocketAddr

Source§

impl GetTypeRegistration for bool

Source§

impl GetTypeRegistration for char

Source§

impl GetTypeRegistration for f32

Source§

impl GetTypeRegistration for f64

Source§

impl GetTypeRegistration for i8

Source§

impl GetTypeRegistration for i16

Source§

impl GetTypeRegistration for i32

Source§

impl GetTypeRegistration for i64

Source§

impl GetTypeRegistration for i128

Source§

impl GetTypeRegistration for isize

Source§

impl GetTypeRegistration for u8

Source§

impl GetTypeRegistration for u16

Source§

impl GetTypeRegistration for u32

Source§

impl GetTypeRegistration for u64

Source§

impl GetTypeRegistration for u128

Source§

impl GetTypeRegistration for ()

Source§

impl GetTypeRegistration for usize

Source§

impl GetTypeRegistration for String

Source§

impl GetTypeRegistration for TypeId

Source§

impl GetTypeRegistration for RangeFull

Source§

impl GetTypeRegistration for Duration

Source§

impl GetTypeRegistration for OsString

Source§

impl GetTypeRegistration for PathBuf

Source§

impl GetTypeRegistration for Instant

Source§

impl GetTypeRegistration for NonZeroI8

Source§

impl GetTypeRegistration for NonZeroI16

Source§

impl GetTypeRegistration for NonZeroI32

Source§

impl GetTypeRegistration for NonZeroI64

Source§

impl GetTypeRegistration for NonZeroI128

Source§

impl GetTypeRegistration for NonZeroIsize

Source§

impl GetTypeRegistration for NonZeroU8

Source§

impl GetTypeRegistration for NonZeroU16

Source§

impl GetTypeRegistration for NonZeroU32

Source§

impl GetTypeRegistration for NonZeroU64

Source§

impl GetTypeRegistration for NonZeroU128

Source§

impl GetTypeRegistration for NonZeroUsize

Source§

impl GetTypeRegistration for AtomicBool

Source§

impl GetTypeRegistration for AtomicI8

Source§

impl GetTypeRegistration for AtomicI16

Source§

impl GetTypeRegistration for AtomicI32

Source§

impl GetTypeRegistration for AtomicI64

Source§

impl GetTypeRegistration for AtomicIsize

Source§

impl GetTypeRegistration for AtomicU8

Source§

impl GetTypeRegistration for AtomicU16

Source§

impl GetTypeRegistration for AtomicU32

Source§

impl GetTypeRegistration for AtomicU64

Source§

impl GetTypeRegistration for AtomicUsize

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>

Source§

impl<K, V, S> GetTypeRegistration for IndexMap<K, V, S>

Source§

impl<K, V, S> GetTypeRegistration for HashMap<K, V, S>

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, S> GetTypeRegistration for IndexSet<T, S>

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§