src/type_data.rs

bevy · crates/bevy_reflect/src/type_data.rs · rust · Apache-2.0
dev-tools

Trait and utilities for registering and cloning type metadata in Bevy's reflection system.

// Source: https://github.com/bevyengine/bevy | License: Apache-2.0
// Provided via justclaw.it.com; keep this notice with the code.
use ::alloc::boxed::Box;
use bevy_reflect::TypeRegistration;
use downcast_rs::{impl_downcast, Downcast};

/// A trait for representing type metadata.
///
/// Type data can be registered to the [`TypeRegistry`] and stored on a type's [`TypeRegistration`].
///
/// While type data is often generated using the [`#[reflect_trait]`](crate::reflect_trait) macro,
/// almost any type that implements [`Clone`] can be considered "type data".
/// This is because it has a blanket implementation over all `T` where `T: Clone + Send + Sync + 'static`.
///
/// For creating your own type data, see the [`CreateTypeData`] trait.
///
/// See the [crate-level documentation] for mo

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key