bevy_reflect

Macro impl_from_reflect_value

Source
impl_from_reflect_value!() { /* proc-macro */ }
Expand description

A macro used to generate a FromReflect trait implementation for the given type.

This is functionally the same as deriving FromReflect on a type that derives Reflect using the #[reflect_value] container attribute.

The only reason this macro exists is so that bevy_reflect can easily implement FromReflect on primitives and other Rust types internally.

Please note that this macro will not work with any type that derives Reflect normally or makes use of the impl_reflect_value! macro, as those macros also implement FromReflect by default.

§Examples

impl_from_reflect_value!(foo<T1, T2: Baz> where T1: Bar);