bevy/crates/bevy_reflect/bevy_reflect_derive/src
Gino Valente 3a93b677a1 bevy_reflect: Added get_boxed method to reflect_trait (#4120)
# Objective

Allow `Box<dyn Reflect>` to be converted into a `Box<dyn MyTrait>` using the `#[reflect_trait]` macro. The other methods `get` and `get_mut` only provide a reference to the reflected object.

## Solution

Add a `get_boxed` method to the `Reflect***` struct generated by the `#[reflect_trait]` macro. This method takes in a `Box<dyn Reflect>` and returns a `Box<dyn MyTrait>`.


Co-authored-by: MrGVSV <49806985+MrGVSV@users.noreply.github.com>
2022-05-20 13:31:49 +00:00
..
container_attributes.rs bevy_reflect: Small refactor and default Reflect methods (#4739) 2022-05-18 12:26:11 +00:00
derive_data.rs bevy_reflect_derive: Tidying up the code (#4712) 2022-05-12 19:43:23 +00:00
field_attributes.rs bevy_reflect_derive: Tidying up the code (#4712) 2022-05-12 19:43:23 +00:00
from_reflect.rs bevy_reflect_derive: Tidying up the code (#4712) 2022-05-12 19:43:23 +00:00
impls.rs bevy_reflect: Small refactor and default Reflect methods (#4739) 2022-05-18 12:26:11 +00:00
lib.rs bevy_reflect_derive: Tidying up the code (#4712) 2022-05-12 19:43:23 +00:00
reflect_value.rs bevy_reflect_derive: Tidying up the code (#4712) 2022-05-12 19:43:23 +00:00
registration.rs bevy_reflect_derive: Tidying up the code (#4712) 2022-05-12 19:43:23 +00:00
trait_reflection.rs bevy_reflect: Added get_boxed method to reflect_trait (#4120) 2022-05-20 13:31:49 +00:00
type_uuid.rs bevy_reflect_derive: Tidying up the code (#4712) 2022-05-12 19:43:23 +00:00
utility.rs bevy_reflect_derive: Tidying up the code (#4712) 2022-05-12 19:43:23 +00:00